-
Notifications
You must be signed in to change notification settings - Fork 491
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
panic occurred: interface conversion: resolvable.Resolvable is nil, not *resolvable.Object #125
Comments
I've seen that error before. When I encountered it it ended up being because I had forgotten to declare I think the problem in your case is that schemas must have a Query type. It's not optional. (See Initial Types from the spec: "The query type must always be provided, and is an Object base type.") Try adding an empty query object to the schema:
This case should definitely panic with a better error message though, so IMO this issue should stay open. |
oh doh....... thank you! |
just tried it and it worked, thanks again really appreciate it 👍 |
Np! I'm working on a PR btw to give a better error message in this case since it's an easy mistake to make. |
Consistent with [schema parsing behavior from graphql-js][1], this commit allows graphql-go to infer entry point types without an explicit `schema` declaration if there are types in the schema named "Query", "Mutation", or "Subscription". It also returns a more descriptive error message if no query type is declared, which fixes graph-gophers#125. Previously if no `schema` declaration was present a cryptic panic would be thrown at runtime. (`interface conversion: resolvable.Resolvable is nil, not *resolvable.Object`) [1]: https://github.com/graphql/graphql-js/blob/master@{2017-11-18}/src/utilities/buildASTSchema.js#L167-L221
Consistent with [schema parsing behavior from graphql-js][1], this commit allows graphql-go to infer entry point types without an explicit `schema` declaration if there are types in the schema named "Query", "Mutation", or "Subscription". It also returns a more descriptive error message if no query type is declared, which fixes graph-gophers#125. Previously if no `schema` declaration was present a cryptic panic would be thrown at runtime. (`interface conversion: resolvable.Resolvable is nil, not *resolvable.Object`) [1]: https://github.com/graphql/graphql-js/blob/master@{2017-11-18}/src/utilities/buildASTSchema.js#L167-L221
Consistent with [schema parsing behavior from graphql-js][1], this commit allows graphql-go to infer entry point types without an explicit `schema` declaration if there are types in the schema named "Query", "Mutation", or "Subscription". It also returns a more descriptive error message if no query type is declared, which fixes graph-gophers#125. Previously if no `schema` declaration was present a cryptic panic would be thrown at runtime. (`interface conversion: resolvable.Resolvable is nil, not *resolvable.Object`) [1]: https://github.com/graphql/graphql-js/blob/master@{2017-11-18}/src/utilities/buildASTSchema.js#L167-L221
Consistent with [schema parsing behavior from graphql-js][1], this commit allows graphql-go to infer entry point types without an explicit `schema` declaration if there are types in the schema named "Query", "Mutation", or "Subscription". It also returns a more descriptive error message if no query type is declared, which fixes graph-gophers#125. Previously if no `schema` declaration was present a cryptic panic would be thrown at runtime. (`interface conversion: resolvable.Resolvable is nil, not *resolvable.Object`) It now panics with `graphql: must provide "schema" definition with "query" type or a type named "Query"` [1]: https://github.com/graphql/graphql-js/blob/master@{2017-11-18}/src/utilities/buildASTSchema.js#L167-L221
Consistent with [schema parsing behavior from graphql-js][1], this commit allows graphql-go to infer entry point types without an explicit `schema` declaration if there are types in the schema named "Query", "Mutation", or "Subscription". It also returns a more descriptive error message if no query type is declared, which fixes graph-gophers#125. Previously if no `schema` declaration was present a cryptic panic would be thrown at runtime. (`interface conversion: resolvable.Resolvable is nil, not *resolvable.Object`) It now errors at schema parse time with `graphql: must provide "schema" definition with "query" type or a type named "Query"`. [1]: https://github.com/graphql/graphql-js/blob/master@{2017-11-18}/src/utilities/buildASTSchema.js#L167-L221
Consistent with [schema parsing behavior from graphql-js][1], this commit allows graphql-go to infer entry point types without an explicit `schema` declaration if there are types in the schema named "Query", "Mutation", or "Subscription". It also returns a more descriptive error message if no query type is declared, which fixes graph-gophers#125. Previously if no `schema` declaration was present a cryptic panic would be thrown at runtime. (`interface conversion: resolvable.Resolvable is nil, not *resolvable.Object`) It now errors at schema parse time with `graphql: must provide "schema" definition with "query" type or a type named "Query"`. [1]: https://github.com/graphql/graphql-js/blob/master@{2017-11-18}/src/utilities/buildASTSchema.js#L167-L221
Please what should be the I am having this error
|
This issue has been fixed by #364
This is the code that returns the error. |
hey guys, how do I get past this error and what am I doing wrong?
panic occurred: interface conversion: resolvable.Resolvable is nil, not *resolvable.Object
below I have my schema and resolvers for reference, thanks in advance for your help
The text was updated successfully, but these errors were encountered: