anyone has example of prisma with ApolloServer (ap...
# orm-help
s
anyone has example of prisma with ApolloServer (apollo-server-lambda integration)? I am receiving this error if I integrate prisma with apolloserver Cannot return null for non-nullable field User.id.
j
can you share you resolvers?
s
Query: { user: (_, args, context, info) => { console.log(‘-----------------------------------‘); console.log(args); console.log(‘-----------------------------------’); return context.prisma.query.user( { where: { id: args.where.id } }, info ); } }
j
looks correct, are you sure
args.where.id
present?
logging result of
context.prisma.query.user
call will be useful
it looks like the user is not found
s
okay, I will check Thanks for reply
👍 1
its was my resolver problem got it resolved, Thanks for help
👍 1
is there any way to restrict users from accessing playground without authentication. I have added PRISMA_MANAGEMENT_API_SECRET and it works fine when I am trying to access prisma service from CLI however I can still access playground from prisma end point
j
not that I'm aware of, considering prisma is a private API it should be kept private by default or accessible with a VPN or only by other services in the same VPC
s
okay
hey
got solution over here https://www.prisma.io/docs/prisma-graphql-api/reference/authentication-ghd4/ we need to set following env variables endpoint: https://eu1.prisma.sh/john-doe/demo/dev # deployed to a Prisma Demo server datamodel: datamodel.prisma
secret: my-secret-42