Skip to content

Instantly share code, notes, and snippets.

@bogoslavskiy
Created March 5, 2020 18:39
Show Gist options
  • Save bogoslavskiy/f41b848c711fbcabdd850e71433f0f17 to your computer and use it in GitHub Desktop.
Save bogoslavskiy/f41b848c711fbcabdd850e71433f0f17 to your computer and use it in GitHub Desktop.
[...]
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