You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have started migrating our GraphQL lib to GraphQL-core-next and things are looking great so far. build_schema util allowed us to remove our own implementation that did the same thing. However, we've found that if you try to extend existing type using extend, it will silently skip it and do nothing.
Looking around the code, I see that logic for extending the schema is quite complexy, and so can understand why build_schema doesn't support it, but perhaps extend_schema should support differences only mode, or part of its logic could be extracted to utility function returning diff from schema and Source?
Apollo-Server for reference of what we are trying to do.
Thank you for all the amazing work!
The text was updated successfully, but these errors were encountered:
Thank you for the feedback. The idea behind graphql-core-next is to replicate the latest graphql.js as closely as possible.
It seems the same problem exists in graphql.js, and they're trying to fix it in 14.1.0 - build_schema and extend_schema are currently under heavy refactoring in graphql.js. I will migrate these changes then back to graphql-core-next.
If you still find something that works in the current graphql.js that does not work here, let me know.
You might also want to join the conversation over at graphql.js to push this forward.
I've did a quick test with graphql-core-next==1.0.3 and following SDL and its not working:
type Query {
year: Int
}
extend type Query {
month: Int
}
Following with the issue for GraphQL.js, it seems that their plan was to handle this by raising an exception when there's extend in SDL passed to build_schema: graphql/graphql-js#922
So I'm guessing we'll have to do custom implementation like how graphql-tools does it.
I'm closing this as I think this should be solved in GraphQL.js and we simply follow. As far as I understand, they want to support "extend type" in build_schema in version 15.
Hello!
We have started migrating our GraphQL lib to GraphQL-core-next and things are looking great so far.
build_schema
util allowed us to remove our own implementation that did the same thing. However, we've found that if you try to extend existing type usingextend
, it will silently skip it and do nothing.Looking around the code, I see that logic for extending the schema is quite complexy, and so can understand why
build_schema
doesn't support it, but perhapsextend_schema
should supportdifferences only
mode, or part of its logic could be extracted to utility function returning diff from schema andSource
?Apollo-Server for reference of what we are trying to do.
Thank you for all the amazing work!
The text was updated successfully, but these errors were encountered: