Skip to content

Commit

Permalink
Step 7.5: Add Subscription.messageAdded resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
DAB0mB authored and Urigo committed Jul 20, 2019
1 parent 84af70e commit 4891922
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions schema/resolvers.ts
Expand Up @@ -55,6 +55,13 @@ const resolvers: Resolvers = {
return message;
},
},

Subscription: {
messageAdded: {
subscribe: (root, args, { pubsub }) =>
pubsub.asyncIterator('messageAdded'),
},
},
};

export default resolvers;

0 comments on commit 4891922

Please sign in to comment.