import { Prisma } from '@prisma/client' // 1: Define a type that includes the relation to Post const userWithPosts = Prisma.validator<Prisma.UserArgs>()({ include: { posts: true }, }) // 2: Define a type that only contains a subset of the scalar fields const userPersonalData = Prisma.validator<Prisma.UserArgs>()({ select: { email: true, name: true }, }) // 3: This type will include a user and all their posts type UserWithPosts = Prisma.UserGetPayload<typeof userWithPosts>
подожди, ну это же по факту ты сам создаешь типы, а не призма
А какая разница ?) эти типы динамические
ну по факту 3 варианта есть. Ты из доки про валидатор призмы и PromiseReturnType вычитал?
Обсуждают сегодня