How to get enums in prisma client?

You can access the user_type enum in your application code like this: import {user_type } from “@prisma/client”; let foo: user_type = “superadmin”; // use like any other type/enum How you plan to connect this to the client-side or send it there is up to you. Typically Prisma types reside in the server-side of your code, … Read more

get full type on prisma client

An alternate method (my preferrence) to get the “full” type, or the model with all of its possible relations, is to use the GetPayload version of your model type. The type is a generic that can receive the same object you pass to your query. import { PrismaClient, Prisma } from “@prisma/client”; const prisma = … Read more