-
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
v2: GraphQL peers and type packages. #4711
Comments
I think this makes sense — it should be scalablish — people wanting new ones can just PR in the new field type — same as React did for years with DOM property support. |
What is the best way to pass We do pass |
I started looking into doing this and noticed that Right now I'm leaning towards exporting -const { GraphQLString } = require(`graphql`)
+const { GraphQLString } = require(`gatsby/graphql`) Didn't try it yet but it shouldn't conflict with runtime stuff gatsby "export" using webpack alias - https://github.com/gatsbyjs/gatsby/blob/v2/packages/gatsby/src/utils/webpack.config.js#L343 Thoughts on this approach? |
Done in #5415 |
I think we need to come up with a better strategy for the duplicate
graphql
issues. The main one is well known, regardless of version mismatch graphql will not run if there are multiple copies, which is dumb. The concern on the horizon (especially with theming) is that any custom types, inadvertently have this problem as well. case in point, bothgatsby-transformer-remark
andgatsby-transformer-react-docgen
usegraphql-type-json
, but if the package isn't deduped that will break, with gql complaining of an existing type named 'JSON' already.The only sort of approach i can think that might help here is to do what we do with webpack and provide the
graphql
object to plugins as well as a set of custom scalars like JSON. That may not super scalable tho :/The text was updated successfully, but these errors were encountered: