Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GraphQL server subscriptions
import { PubSub, SubscriptionManager } from 'graphql-subscriptions';
import schema from './schema';
const pubsub = new PubSub();
const subscriptionManager = new SubscriptionManager({
schema,
pubsub,
setupFunctions: {
tagAdded: (options, args) => {
console.log(args);
return {
tagAdded: tag => {
// This is not called
console.log(tag);
return tag.type === args.type;
},
};
},
},
});
export { subscriptionManager, pubsub };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment