Extra query into object (GetPayload)
I want to extract this query into an object so I can reuse it in different places. But something is wrong with my
UserPostData
declaration, because it is missing some fields.3 Replies
Ok, I think I figured it out. I need to use Prisma.validator as described here: https://stackoverflow.com/questions/68366105/get-full-type-on-prisma-client
Stack Overflow
get full type on prisma client
When i generate my prisma client with prisma generate, i got an index.d.ts with all types from my database.
But the probleme is that all type are "single" and there is no relations.
When i
You can use
const name = {} satisfies Prisma.Type
if you are above TS 4.9thank you