Showing
2 changed files
with
7 additions
and
4 deletions
1 | -import { prisma } from "../../../utils"; | 1 | +import { isAuthenticated, prisma } from "../../../utils"; |
2 | +import { NEW_MESSAGE_TOPIC } from "../../../topics"; | ||
2 | 3 | ||
3 | export default { | 4 | export default { |
4 | Subscription: { | 5 | Subscription: { |
5 | - sendMessage: async (_, args) => { | 6 | + sendMessage: { |
6 | - const { message } = args; | 7 | + subscribe: async (_, __, { request, pubsub }) => { |
8 | + pubsub.asyncIterator(NEW_MESSAGE_TOPIC); | ||
9 | + }, | ||
7 | }, | 10 | }, |
8 | }, | 11 | }, |
9 | }; | 12 | }; | ... | ... |
-
Please register or login to post a comment