omar-dulaimi / prisma-class-validator-generator

Prisma 2+ generator to emit typescript models of your database with class validator
MIT License
71 stars 11 forks source link

generate same output as in yup generator #8

Closed Morriz closed 2 years ago

Morriz commented 2 years ago

Problem

Hi, I have switched from yup to this generator, as I want universal validation, and prisma-graphql only supports class-validator. However, this generator only generates the base models.

Now it is not possible use any of the models in mutations as the validator checks every property, even though I am in partial update mode.

Example: With the yup generator I was simply able to pick the UserUpdateInput version to support partial updates.

Suggested solution

Generate all possible models from every resolver that prisma-graphql generates.

Morriz commented 2 years ago

closing in favor of #9