Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphql basic structure and some queries #741

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

JonMosenkis
Copy link
Contributor

Setting up a basic module for graphql queries. This looks pretty promising and very easy to enhance and expand in the future. I'd love to hear feedback!

@JonMosenkis JonMosenkis marked this pull request as draft January 20, 2022 15:09
@JonMosenkis
Copy link
Contributor Author

This is still a work in progress, so I'd strongly recommend against merging at this time. But I would like periodic feedback if possible.

@JonMosenkis
Copy link
Contributor Author

I've been using the graphql-request library from npm to execute the graph querries. For example, to query indices I set up the file graphql.mjs as so:

import { request, gql } from 'graphql-request'

const query = gql`
  {
      Index(title: "Genesis") {
        title
        categories
        node {
          depth
          sectionNames
          titles {
            text
            primary
          }
        }
        altStructs
      }
  }
`

request('http://localhost:8000/api/graphql', query)
.then(data => {
  console.log(data);
})
.catch(err => console.error(err));

@JonMosenkis JonMosenkis changed the title graphql basic structure and beginning of index query graphql basic structure and some queries Jan 20, 2022
@EliezerIsrael EliezerIsrael mentioned this pull request Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant