Providing .graphql file with correct schema gives Loading schema.graphql gives `Query root type must be provided.` error
See original GitHub issueDescribe the bug
Providing .graphql file with correct schema gives Loading schema.graphql gives Query root type must be provided
. error
To Reproduce Steps to reproduce the behavior:
- Use the following schema:
schema {
query: QueryRoot
}
type QueryRoot {
"""Fetches an object given its ID"""
node(
"""The ID of an object"""
id: ID!
): Node
}
- Use any document
- Run the following command:
gql-gen --watch --schema './src/app/graphql/schema.graphql' --template graphql-codegen-apollo-angular-template --out './src/app/graphql/queries.ts' './src/**/*.graphql'
Expected behavior Expected schema to be loaded from .graphql file.
Environment:
- OS: alpine
- Codegen: 0.13.0
- Node: 10.11
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (4 by maintainers)
Top Results From Across the Web
graphqljs - Query root type must be provided - Stack Overflow
I cannot pass null and if I pass an empty GraphQLObjectType it gives me the error: Type Query must define one or more...
Read more >query root type must be provided graphql - You.com
Solution 1. All servers running with GraphQL must have at least one @Query () to be considered a valid GraphQL server. Without it,...
Read more >GraphQL schema basics
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 >Loading GraphQL Schemas from Different Sources
You can specify a GraphQL endpoint, local introspection JSON file, code file that export s a GraphQLSchema, AST string and .graphql files ......
Read more >Execution - GraphQL
In this example, our Query type provides a field called human which accepts the argument id . The resolver function for this field...
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
Fixed in 0.14.2 🎉 @wesselvdv @furier
@dotansimha @kamilkisiela works like a charm when i upgraded all the packages to that version 😃