I’m building on top of a postgres database. Prisma is generating the mutations/queries that, in most cases, I want to directly use in my end user graphql schema, for example
schema.graphql file (which defines my apollo server schema), I’ve tried importing the generated prisma mutation:
# import Mutation.updateUser from './generated/prisma.graphql'
This works without error, and when I run my apollo server graphql playground, I get the full schema for
updateUser auto completing, and I’m able to run the mutation.
However, the mutation run just returns
null. I don’t see anything logged in the prisma docker container. I don’t see errors anywhere. I don’t see anything in the DB changed. I’m having the same issue if I try another mutation like
createUser, except the error returned is
Cannot return null for non-nullable field Mutation.createUser
I assume I’m missing something, since I’m expecting this to work out of the box.
Is what I want to do possible? I think I get that I can completely copy all args down from my apollo server and call
prisma.updateUser(), but that seems like duplication to me. I’d rather just selectively expose resolvers and mutations up from Prisma, since they already have the well defined API I want my clients to used.