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

Need some help (Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory.) #3

Open
mitroland opened this issue Oct 26, 2017 · 2 comments

Comments

@mitroland
Copy link

I am trying to use the module but, the result is:

{
"errors": [
{
"message": "Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory."
}
]
}

Query:
{master_tenaga_budaya{nama,no_identitas}}

Log of Schema:

GraphQLSchema {
  _queryType: Query,
  _mutationType: Mutation,
  _subscriptionType: undefined,
  _directives: 
   [ GraphQLDirective {
       name: 'include',
       description: 'Directs the executor to include this field or fragment only when the `if` argument is true.',
       locations: [Array],
       astNode: undefined,
       args: [Array] },
     GraphQLDirective {
       name: 'skip',
       description: 'Directs the executor to skip this field or fragment when the `if` argument is true.',
       locations: [Array],
       astNode: undefined,
       args: [Array] },
     GraphQLDirective {
       name: 'deprecated',
       description: 'Marks an element of a GraphQL schema as no longer supported.',
       locations: [Array],
       astNode: undefined,
       args: [Array] } ],
  astNode: null,
  _typeMap: 
   { Query: Query,
     String: String,
     Node: Node,
     master_lembaga: master_lembaga,
     Int: Int,
     Boolean: Boolean,
     master_tenaga_budaya: master_tenaga_budaya,
     Mutation: Mutation,
     __Schema: __Schema,
     __Type: __Type,
     __TypeKind: __TypeKind,
     __Field: __Field,
     __InputValue: __InputValue,
     __EnumValue: __EnumValue,
     __Directive: __Directive,
     __DirectiveLocation: __DirectiveLocation },
  _implementations: { Node: [ master_lembaga, master_tenaga_budaya ] } }

Model:

module.exports = {
	identity: 'master_tenaga_budaya',
	attributes: {
		doc_id: {type: 'integer', defaultsTo:null},
		nutb: {type: 'string', defaultsTo:null},
		warganegara_indonesia: {type: 'boolean', required: true, defaultsTo: true},
		no_identitas: {type: 'string', unique: true, required: true},
		nama: {type: 'string', required: true},
		tanggal_lahir: {type: 'date', required: true},
		foto: {type: 'string', defaultsTo:null},
		createdAt: {type: 'integer', required: true},
		updatedAt: {type: 'integer', defaultsTo:null},
		revision: {type: 'integer', defaultsTo:0},
		is_deleted: {type: 'boolean', required: true, defaultsTo: false},
		jenis_identitas: {type: 'string', required: true, defaultsTo:'KTP'},
		jenis_kelamin: {type: 'string', enum:['m','f'], defaultsTo:null}
	}
}

Any idea?

@mitroland mitroland changed the title Need some help Need some help (Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory.) Oct 26, 2017
@lyzs90
Copy link

lyzs90 commented Nov 10, 2017

seems like a graphql-js problem, see: graphql/graphql-js#594

Note that basically you need to only have 1 line result for find node_modules -name graphql

you probably installed another version of graphql and it conflicts with the one in waterline-to-graphql i.e. v0.10.1

@agenthunt
Copy link
Owner

Hi, Thanks. yes. That seems to be the issue. Havent had time yet to fix this. Might look into in few days. Meanwhile PRs are welcome.

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

No branches or pull requests

3 participants