CarterGrimmeisen / zod-prisma

A custom prisma generator that creates Zod schemas from your Prisma model.
MIT License
826 stars 86 forks source link

new relationModel with optional relations #143

Open michiim opened 2 years ago

michiim commented 2 years ago

The relationModel is useful for simple models only with only a few relations.

But in real world projects, every model has many relations. In ein ERP solution i would like to validate an invoice with its items (related to invoice). But i don't want to validate the related customer, or products related to the items.

So for me the relationModel ist mostly useless. I would like to have (an additional) relationModel for every model (ex. optionalRelationModel) which has all relations as optional() so i could validate only the things i want.

Thanks