Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ... imports
export default {
// ... queries
mutations: {
async createPoll(parent, args) {
const poll = await pollService.create(args.poll).catch();
pubsub.publish(POLL_CREATED, {
[POLL_CREATED]: poll
})
return poll
},
// ... voteOnPoll
},
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
You can’t perform that action at this time.