Last active
August 14, 2020 11:34
-
-
Save velotiotech/8afe05bc5bda00af40ebbd3699376766 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
function post(parent, args, context, info) { | |
const userId = getUserId(context) | |
const newLink = await context.prisma.link.create({ | |
data: { | |
url: args.url, | |
description: args.description, | |
postedBy: { connect: { id: userId } }, | |
} | |
}) | |
context.pubsub.publish("NEW_LINK", newLink) | |
return newLink | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment