Hey guys, Auto-Completion feature stops working wh...
# orm-help
m
Hey guys, Auto-Completion feature stops working when I pass PrismaCient as prisma to Context in the GrahQL-Yoga server. How did you go around this issue?
Copy code
const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()

const server = new GraphQLServer({
  typeDefs: './src/schema.graphql',
  resolvers,
  context: {
    prisma,
  }
})
https://www.howtographql.com/graphql-js/5-connecting-server-and-database/
r
Typescript or js?
Specifically this one: https://prisma.slack.com/archives/CKQTGR6T0/p1594955158234500?thread_ts=1594888935.203100&cid=CKQTGR6T0 I think it's the
@typedef
comment that does it..
m
Hello @Richard Ward, thank you for the tips. I wish I read it earlier. I was using TypeScript and did some research yesterday. I found GraphQL Nexus and it sounded promising, so I adopted it in my project.
r
No problem, I hope some part of it was useful