Closed ian-viri closed 8 months ago
@ian-viri since the input types are based on prismas generated types, they would just be a copy of the already generated types. So if you need the type of an input schema you can directly import it from prisma client.
Interesting. Does that mean the model types can diverge from the Prisma types in some cases?
@ian-viri in a sense they can diverge from the prisma type when you use the writeNullishInModelTypes
option.
The model types also do not need a direct type annotation unlike the rekursive input types. This ensures that all the zodMethods like .pick
, .omit
etc. work on the model types. Many of these methods are not available on the input types due to the type annotation that is needed to provide the correct typing for recursive types.
All makes sense -- thanks!
For 'model' types we get both a generated schema and a generated type. However, for Input types, we only get the schema. This is true even if
createInputTypes
istrue
.For now I'm manually defining them., but am I missing something? Is there a way to have these auto generated?