Hello everybody, does prismaClient generate type f...
# orm-help
j
Hello everybody, does prismaClient generate type for the client itself (like
PrismaClientType
) ? Also is there some info in the doc about the generated files for prisma client I can read ?
r
@jasci 👋 Could you explain your use case for this?
j
@Ryan Well, just wanted to assign type for the prisma client in context, then whenever I use it I’ll get autocompletion and type checks, whether I properly use a certain method or does a certain model exist in the db, and proper returned types after certain queries. With prisma1 there was the
interface Prisma
, I thought maybe there is something similar in prisma2. Also just wanted to read more about generated files, like an overview, so that I don’t need to review them all.
r
Are you using JavaScript or TypeScript? If using TypeScript, assigning the type
PrismaClient
is enough to get all the types as that is the type you will be interacting with. For JS, you can refer to this: https://www.prisma.io/docs/support/help-articles/autocompletion-in-graphql-resolvers-with-js
✅ 1