graphql-js
graphql-js copied to clipboard
TypeError: PubSub is not a constructor
trafficstars
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
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.