Skip to content

Instantly share code, notes, and snippets.

@LazyFatArrow
Last active May 18, 2019 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LazyFatArrow/061741c1a17ef59dd548a97f4026d235 to your computer and use it in GitHub Desktop.
Save LazyFatArrow/061741c1a17ef59dd548a97f4026d235 to your computer and use it in GitHub Desktop.
import { PubSub } from 'apollo-server'
import { POLL_CREATED } from '../events';
import * as pollService from '../services/poll.service'
const pubsub = new PubSub()
export default {
// ... queries and mutations
subscriptions: {
[POLL_CREATED]: {
subscribe: () => pubsub.asyncIterator(POLL_CREATED),
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment