question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Providing .graphql file with correct schema gives Loading schema.graphql gives `Query root type must be provided.` error

See original GitHub issue

Describe 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:

  1. Use the following schema:
schema {
  query: QueryRoot
}

type QueryRoot {
  """Fetches an object given its ID"""
  node(
    """The ID of an object"""
    id: ID!
  ): Node
}
  1. Use any document
  2. 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:closed
  • Created 5 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dotansimhacommented, Nov 25, 2018

Fixed in 0.14.2 🎉 @wesselvdv @furier

1reaction
furiercommented, Nov 21, 2018

@dotansimha @kamilkisiela works like a charm when i upgraded all the packages to that version 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found