omar-dulaimi / prisma-zod-generator

Prisma 2+ generator to emit Zod schemas from your Prisma schema
MIT License
513 stars 45 forks source link

Added fieldReference support #58

Closed Brettm12345 closed 1 year ago

Brettm12345 commented 1 year ago

Fixes #57

omar-dulaimi commented 1 year ago

Hello @Brettm12345

Sadly, your changes don't quite implement the feature right. You need to generate the right code; which includes new properties like: modelName name typeName isList Check the types inside Prisma Client, you should get an idea about what you need.

Also, make sure to generate for this case only when the user actually enables it through previewFeatures. You could check this other PR as a reference https://github.com/omar-dulaimi/prisma-zod-generator/pull/62