A schema MUST have a 'query' operation defined Error. But I have type Query in my schema.
See original GitHub issueI have added my schema to a .graphql file in my main project directory. I now get this error:
This is very weird because I do have a type Query {}
in my .graphql file with multiple queries in there. When I copied the Query type into an empty .graphql file and I changed all the return types to strings I did not get the error anymore.
To Reproduce
I don’t really know how you could reproduce this I don’t want really share my schema.
Expected behavior I don’t expect a ‘A schema MUST have a ‘query’ operation defined’ error to pop up when there is a type Query in the schema
Version and Environment Details Operation system: Win 10 IDE name and version: Webstorm 2020.3.2 Plugin version: 2.9.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:12
Top Results From Across the Web
A schema MUST have a 'query' operation defined Error. But I ...
I have added my schema to a .graphql file in my main project directory. I now get this error: This is very weird...
Read more >GraphQL: A schema must have a query operation defined
I'm new to GraphQL, what should the query be set to if the actual query operation only has a mutation at the root...
Read more >GraphQL schema basics - Apollo GraphQL Docs
This schema defines a hierarchy of types with fields that are populated from your back-end data stores. The schema also specifies exactly which...
Read more >admin endpoint not working for me - Discuss Dgraph
A schema MUST have a query` operation defined. This is very weird because there is a type Query in the result of the...
Read more >Schemas and Types - GraphQL
Every GraphQL service defines a set of types which completely describe the set of possible data you can query on that service. Then,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@vepanimas
I experience this issue on Webstorm 2021.3.2 and plugin version 3.1.2, even with the simplest example of relay-schema.graphql and .graphqlconfig:
Unfortunately, this is a common error that occurs when the schema could not be built for some reason. I’ve improved error handling and logging in the upcoming version that I’ll release soon.