-
Notifications
You must be signed in to change notification settings - Fork 56
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
Error: Query root type must be provided #610 #73
Comments
@lpender - did you resolve this issue? |
here's the issue — in particular, in https://github.com/graphcool/graphql-import/blob/e5c4b078e4747aa6e3ffec37139451f85011478f/src/index.ts#L263-L271 we should actually be allowing the SchemaTypeDefinition. im not sure what the behavior should be when you find multiple SchemaTypeDefinitions, though, should they be combined? should we throw a warning or just fail if there are collisions, given that we shouldn't expect child documents to re-define the |
i believe is where |
Any fix for this? |
Remember typedefs its just a template string, so.
Works |
Just provide const { ApolloServer, gql } = require("apollo-server");
const todos = [
{ task: "work for today", completed: true },
{ task: "finish home work", completed: false }
];
const typeDefs = gql`
type Todo {
task: String
completed: Boolean
}
type Query {
getTodos: Todo
}
`;
const server = new ApolloServer({
typeDefs: typeDefs
});
server.listen().then(({ url }) => {
console.log(`server listening on ${url}`);
}); |
I'm receiving the error:
Here is my schema:
schema.graphql
I am importing it with
graphql-importer
Shouldn't this be valid?
The text was updated successfully, but these errors were encountered: