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
Empty types are not allowed in schema language, even if they are later extended #450
Comments
related: #293 |
Thanks for the link. Looks like this is a |
It looks like graphql/graphql-js#937 solved this in December 2017, so I think you should revisit this again. It is quite cumbersome to have to define dummy members just to support type weaving in large schemas that are splitted over several files |
@janflyborg This already works in the current version of graphql-tools! The syntax is |
@dallonf I didn't know that. Thanks for the help, I'll try that. |
So I know this is an old issue - but when I do @dallonf's solution I get an error "Type Query must define one or more fields."? |
|
I just discovered this extend feature, which is super cool! My
Query
type had gotten massive and bloated and this looks like the perfect tool to break all of its fields out into many files.The problem: now I don't want anything in the base
Query
definition, since every field that used to be there now feels more at home in another file. But if I have a definition that looks like this (obviously heavily simplified from my use case):(Launchpad version: https://launchpad.graphql.com/13v9kk4n9)
I get the error: "Query fields must be an object with field names as keys or a function which returns such an object."
I would expect that an empty type would be OK if (and only if) there was another type somewhere in the schema that
extended
it.As a workaround, I'm currently putting a dummy field in the root
Query
type.The text was updated successfully, but these errors were encountered: