Error: Query root type must be provided
See original GitHub issueI seem to be getting this error:
https://github.com/prismagraphql/graphql-import/issues/73
I’m running 0.0.10, with a schema generated by graphql-cli
from a gatsby project:
# source: http://0.0.0.0:8000/___graphql
# timestamp: Sat Jul 28 2018 17:46:31 GMT+0000 (Greenwich Mean Time)
schema {
query: RootQueryType
}
"""
A date string, such as 2007-12-03, compliant with the ISO 8601 standard for
representation of dates and times using the Gregorian calendar.
"""
scalar Date
# ...
Here’s the full error:
(node:15016) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Query root type must be provided.
(node:15016) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
No stack trace, unfortunately.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 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 >Get "Query root type must be provided." error when ... - GitHub
Describe the bug Get error when schema's query root type's name isn't "Query". The code will generate without error when the Query root...
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 >Creating an Express and GraphQL Server from Scratch
"message": "Query root type must be provided." This message shows up because of the empty schema we created earlier. So, how does it...
Read more >`yarn graphql-codegen` returns `Error: Query root type must ...
yarn graphql-codegen returns Error: Query root type must be provided. when query root is named other than Query , for example query_root as...
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
const WAUsers = require(‘…/models/wibesAppUsers’); //this is mongodb model
const wAUType = new GraphQLObjectType({ name:‘wAP’, e fields:() => ({ human_name:{type:GraphQLString}, pass_code:{type:GraphQLString}, }) });
const Mutation = new GraphQLObjectType({ name:‘Mutation’, fields:{ addWAUser:{ wAUType, args:{ human_name:{type:new GraphQLNonNull(GraphQLString)}, pass_code:{type:new GraphQLNonNull(GraphQLString)}, }, resolve(parent,args){ let user = new WAUsers({ human_name:args.human_name, pass_code:args.pass_code, }); return user.save(); } } } } })
module.exports = new GraphQLSchema({ mutation:Mutation });
i am importing mongodb model and inserting into it using graphql schema
https://github.com/wibesapp-com/wibes-app/blob/teja/server/schema/schema.js