-
-
Notifications
You must be signed in to change notification settings - Fork 796
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
Blank types for future extension? #293
Comments
+1 |
Yeah this is definitely an issue - it would be best to fix it in the upstream GraphQL.js library, since we use that for parsing the schema string into a schema object. https://github.com/graphql/graphql-js Alternatively, we can add some hacks like inserting a |
Why would not it possible to extend a non-existing type? so if the type does not exist, it will be assumed that it is empty. If I understand correctly, "extend" is an extension to the schema. At least I could not see it in the graphql docs. |
This is something that would have to be implemented in graphql-js. |
Here's a little template for anyone else stumbling on this issue during this train of thought. You can also do it @lokhmakov way, which might be better depending on what you want: #186 |
For anyone else looking for progress on this, here's an associated issue in graphql-js (graphql/graphql-js#937) |
So I'm trying to make a modularized schema and want to combine that with type extension. The problem I'm running into is that I want to put my queries and mutations with my modularized types, but that leaves nothing to put in the starting Query and Mutation types.
I tried putting this at the start of my
typeDefs
array:Sadly, when I try to run my app I get an error saying
RootQuery fields must be an object with field names as keys or a function which returns such an object.
.Is there a better way to achieve this?
The text was updated successfully, but these errors were encountered: