so I want to point to another graphql server, where should I do that? in the webpack configuration?
Interesting, I've also been thinking about this a little. If gatsby's data generator was it's own module we could use gatsby plugins in non-gatsby apps too.
For instance if it had the following api:
cont { schema } = await require('gatsby-data')(gatsbyConfig)
Then we could load that schema and run it with other apps, it'd also have the side effect of have the schema generation self contained and easy to run gatsby without graphql for instance:
gatsby develop --no-data
Is there a way to do this without building a gatsby-source plugin for the external graphql server?
Not yet. There's a proposal for mirroring external GraphQL servers but the work needs done still.
@KyleAMathews any updates on this proposal?
I tried this with GraphCMS source plugin, that works fine! I think that could be used as a base for a more generic GraphQL-source plugin. By the way I must say you get a pretty nice workflow mocking up your API with GraphCMS and using Gatsby to build a frontend. Using Markdown for that is still faster though ;)
Any update on this with v2? We have an external GraphQL server that we wish to use. Is the only way to write a source plugin?
Closing this issue as it's fairly old and we have far too many open issues! If you have additional problems in this area, please open a new issue!
Most helpful comment
Interesting, I've also been thinking about this a little. If gatsby's data generator was it's own module we could use gatsby plugins in non-gatsby apps too.
For instance if it had the following api:
Then we could load that schema and run it with other apps, it'd also have the side effect of have the schema generation self contained and easy to run gatsby without graphql for instance: