Last active
May 18, 2019 17:19
-
-
Save LazyFatArrow/061741c1a17ef59dd548a97f4026d235 to your computer and use it in GitHub Desktop.
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 } 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