Open hco opened 1 year ago
Indeed, some things got broken. If you try the generated schemas with tRPC, you would face this error(among others):
'PostFindManySchema' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
So, until we found a solution for that problem, we can't really merge this PR sadly
Typing them explicitly with
ZodType
removes some features from the generated schemas.For example,
ZodType
lacks features fromZodObject
such as.pick
, or.merge
.Others have stumbled upon this issue as well, for example, https://github.com/omar-dulaimi/prisma-zod-generator/discussions/24 and https://github.com/omar-dulaimi/prisma-zod-generator/issues/25 bring this up. In https://github.com/omar-dulaimi/prisma-zod-generator/issues/25#issuecomment-1294673830 someone brings up that the change I made broke something in the generator for them. In my case, nothing broke - but this could of course have unwanted side effects. In my understanding,
ZodObject
extendsZodType
, which reduces the risk of issues.But I am really not sure about this.