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

"Schema must be an instance of GraphQLSchema." when creating subscription binding #54

Closed
marktani opened this issue Jan 7, 2018 · 2 comments
Assignees

Comments

@marktani
Copy link
Contributor

marktani commented Jan 7, 2018

Executing this subscription resolver

  Subscription: {
    publications: {
      subscribe: async(parent, args, ctx, info) => {
        return ctx.db.subscription.post({}, info)
      },
    },
  }

leads to this error:

Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory.

See https://github.com/marktani/reproduction-subscriptions for a complete reproduction.

@kbrandwijk
Copy link
Contributor

I am unable to reproduce this with these dependency versions:

"dependencies": {
    "graphcool-binding": "1.3.5",
    "graphql-yoga": "1.1.7"
  },
  "devDependencies": {
    "graphcool": "^1.0.0-alpha4.2.4"
  }

@schickling
Copy link
Contributor

This looks like a problem with @marktani's local setup. For everyone running into this problem, please try to delete the node_modules folder and reinstall via npm or yarn.

Please be aware that this can be especially a problem when linking node modules. I recommend using yarn workspaces in that case.

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

3 participants