Infer type from create query?
here's the function that creates a new
Schedule
. Attention to the shape, not data
I want to get the type of the Lesson
of the shape in this function. so it has to look like this
so that I can use somewhere else
Is there a utility type in prisma to infer this shape?Solution:Jump to solution
Hello @piscopancer 👋
Have you seen this guide?
https://prisma.io/docs/orm/prisma-client/type-safety/operating-against-partial-structures-of-model-types#problem-using-variations-of-the-generated-model-type
...
Operating against partial structures of your model types | Prisma D...
This page documents various scenarios for using the generated types from the Prisma namespace
2 Replies
Solution
Hello @piscopancer 👋
Have you seen this guide?
https://prisma.io/docs/orm/prisma-client/type-safety/operating-against-partial-structures-of-model-types#problem-using-variations-of-the-generated-model-type
To me, it seems that you want to generate a type with relation fields (subject relation in this example)
Operating against partial structures of your model types | Prisma D...
This page documents various scenarios for using the generated types from the Prisma namespace
thanks
it will help me
sounds like what I need ofc