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 May 20, 2020
1 parent a33a9f4 commit 3481d1c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions schema/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ const resolvers: Resolvers = {
return message;
},
},

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

export default resolvers;

0 comments on commit 3481d1c

Please sign in to comment.