Created
November 1, 2016 14:46
-
-
Save Akryum/79ab2c13848d20e0b89469b194c1077a to your computer and use it in GitHub Desktop.
GraphQL server subscriptions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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