Created
March 21, 2023 17:25
-
-
Save PatrikValkovic/dd93060608e0925a384cb1be321de874 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
export const newMessage = subscriptionField('newMessage', { | |
type: nonNull('Message'), | |
subscribe(_, __, ctx) { | |
return ctx.sub.subscribe(`message-${ctx.userId}`); | |
}, | |
resolve(obj: NewMessageEvent) { | |
return obj.message; | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment