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

"extend type" not supported in input to build_schema #14

Closed
rafalp opened this issue Nov 16, 2018 · 4 comments
Closed

"extend type" not supported in input to build_schema #14

rafalp opened this issue Nov 16, 2018 · 4 comments
Labels
investigate Needs investigaton or experimentation

Comments

@rafalp
Copy link
Contributor

rafalp commented Nov 16, 2018

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 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!

@Cito
Copy link
Member

Cito commented Nov 16, 2018

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.

@Cito
Copy link
Member

Cito commented May 3, 2019

Could you check if graphql-core-next 1.0.3 (based on GraphQL.js 14.2.1) is better in this regard?

@Cito Cito added the investigate Needs investigaton or experimentation label May 3, 2019
@rafalp
Copy link
Contributor Author

rafalp commented May 6, 2019

Hi, thanks for coming back with this info!

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.

@Cito
Copy link
Member

Cito commented Jul 6, 2019

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.

@Cito Cito closed this as completed Jul 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Needs investigaton or experimentation
Projects
None yet
Development

No branches or pull requests

2 participants