diff --git a/server/src/resolvers/Mutation.js b/server/src/resolvers/Mutation.js index 82a728e..e637d27 100644 --- a/server/src/resolvers/Mutation.js +++ b/server/src/resolvers/Mutation.js @@ -3,10 +3,12 @@ const jwt = require('jsonwebtoken') const { APP_SECRET, getUserId } = require('../utils') function post(parent, args, context) { + const userId = getUserId(context); return context.prisma.createLink({ url: args.url, description: args.description, - }) + postedBy: { connect: { id: userId } } + }); } async function signup(parent, args, context) {