Created
March 5, 2020 18:39
-
-
Save bogoslavskiy/f41b848c711fbcabdd850e71433f0f17 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
[...] | |
const MessagesMutation: MessagesMutationResolvers = { | |
async send(_, { input }) { | |
const message = new MessageModel(input); | |
await message.save(); | |
pubsub.publish(NEW_MESSAGE_EVENT, { message }); | |
sendPushNotification({ | |
title: input.senderName, | |
body: message.text, | |
}); | |
return message; | |
} | |
}; | |
[...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment