Open CarterGrimmeisen opened 2 years ago
The only issue that I see with this approach is using these schemas to validate forms in the frontend. We could use null
on the frontend and add a transform that converts it to Prisma.JsonNull
or Prisma.DbNull
According to Prisma's docs JSON fields cannot be directly set to null. Instead one can utilize
Prisma.JsonNull
orPrisma.DbNull
in order to set the field to a JSON value of null or toNULL
the db field respectively.My current plan is to update the generated zod schemas to match this behavior but I am curious as to what others think about this.