-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Pull GraphQL schema inference out into a separate module #1116
Comments
Hey! This is going to be awesome! It'll be great for Gatsby to make things more modular + it'll be cool to see other people make use of the code for whatever it is they make use of it for. The code is already fairly well abstracted in the The main decoupling work I think is right now it knows how to reach into Gatsby's internals to pull out "nodes". Those would have to be passed in. One possible interface. const makeServer = require(`json-graphql-server`)
const schema = makeServer(nodes) Any data passed in would need to conform to the Gatsby node format (or abstract this away somehow) https://www.gatsbyjs.org/docs/node-interface/ Thinking about this more, it wouldn't be the best for Gatsby to pull this out completely — that'd mean copying over all nodes into GraphQL which would eat up a lot more memory plus slow things down with all the copying... hmmm... yeah, instead of taking a nodes array, it'd need to take a Some interesting files to look at:
I'd suggest also following the getting started guide for v1 @ https://www.gatsbyjs.org/docs/ and installing the gatsby-starter-blog and playing around in graphiql (it's included with the Gatsby dev server). |
See gatsbyjs#1116 for the reason behind this change.
Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help! |
As discussed on Twitter, I'd like to help take the Gatsby GraphQL schema inference code and make it into a more generally usable module that Gatsby and other tools could consume.
That said, I know nothing about Gatsby, so it's gonna take me a bit to figure out where things are and how the GraphQL bits currently interact with it. Would appreciate pointers there.
The text was updated successfully, but these errors were encountered: