Skip to content
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: Mutations fields must be an object with field names as keys or a function which returns such an object. #21

Closed
morenoh149 opened this issue Mar 7, 2017 · 1 comment

Comments

@morenoh149
Copy link

morenoh149 commented Mar 7, 2017

Not sure if I should ask here or upstream. I'm trying to run this tool on an existing api running sequelize.

$ node index.js
{"name":"foo","version":"0.0.1","event":"state","state":"booting"}
/Users/harrymoreno/programming/foo/node_modules/graphql/jsutils/invariant.js:19
    throw new Error(message);
    ^

Error: Mutations fields must be an object with field names as keys or a function which returns such an object.
    at invariant (/Users/harrymoreno/programming/foo/node_modules/graphql/jsutils/invariant.js:19:11)
    at defineFieldMap (/Users/harrymoreno/programming/foo/node_modules/graphql/type/definition.js:324:27)
    at GraphQLObjectType.getFields (/Users/harrymoreno/programming/foo/node_modules/graphql/type/definition.js:285:44)
    at /Users/harrymoreno/programming/foo/node_modules/graphql/type/schema.js:207:27
    at typeMapReducer (/Users/harrymoreno/programming/foo/node_modules/graphql/type/schema.js:219:7)
    at Array.reduce (native)
    at new GraphQLSchema (/Users/harrymoreno/programming/foo/node_modules/graphql/type/schema.js:95:34)
    at getSchema (/Users/harrymoreno/programming/foo/node_modules/graphql-sequelize-crud/lib/index.js:887:10)

Is my data model not compatible with graphql?

@Glavin001
Copy link
Owner

Please provide a sample code snippet which can be used to reproduce this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants