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

TypeError: PubSub is not a constructor #87

Open
luane-aquino opened this issue Aug 9, 2021 · 2 comments
Open

TypeError: PubSub is not a constructor #87

luane-aquino opened this issue Aug 9, 2021 · 2 comments

Comments

@luane-aquino
Copy link

Hi, I am getting this error TypeError: PubSub is not a constructor when importing PubSub from apollo-server

code snippet:
const { PubSub} = require('apollo-server');

const pubsub = new PubSub();

I appreciate any help, thank you

@dhyeythumar
Copy link

dhyeythumar commented Aug 11, 2021

Yes this won't work with apollo-server v3.
On their docs it says:

Apollo Server 3 removes built-in support for subscriptions.

Check out their docs on how to setup the subscriptions for v3:
https://www.apollographql.com/docs/apollo-server/data/subscriptions/

Else you can use the same package version used in this project.

@dracofulmen
Copy link

Use this command to revert to the previous version of apollo-server:

npm install [email protected]

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