Infer type from create query?
here's the function that creates a new
I want to get the type of the
so that I can use somewhere else
Is there a utility type in prisma to infer this shape?
Schedule. Attention to the shape, not dataI want to get the type of the
Lesson of the shape in this function. so it has to look like thisso that I can use somewhere else
Is there a utility type in prisma to infer this shape?
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)
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)
This page documents various scenarios for using the generated types from the Prisma namespace
