react-apollo icon indicating copy to clipboard operation
react-apollo copied to clipboard

Add user to link

Open zwhitchcox opened this issue 5 years ago • 2 comments

This was taken out for some reason

zwhitchcox avatar Apr 06 '19 18:04 zwhitchcox

Hi @zwhitchcox a good catch. But you forgot the line with the userId.

So please edit your pull request and add that line: const userId = getUserId(context)

So that postMutation will get:

function post(parent, args, context) {
  const userId = getUserId(context)
  return context.prisma.createLink({
    url: args.url,
    description: args.description,
    postedBy: { connect: { id: userId } },
  })
}

kwoxer avatar Apr 11 '20 13:04 kwoxer

Btw https://github.com/howtographql/react-apollo/pull/76/files already does the same thing.

This is obsolete. Please merge the 76 pull request instead.

kwoxer avatar Apr 11 '20 13:04 kwoxer