Open owenr88 opened 11 months ago
I've done a little more investigating and it seems this has an unintended effect on schemas with z.lazy()
where it makes the type an any
. Argh! I've marked this PR as draft for now.
Any suggestions how we could get around this? One solution is keeping the original, but also exposing the raw z.object
schema:
const Schema = z
.object({
id: z.number().optional(),
email: z.string().optional(),
})
.strict() satisfies z.ZodType<Prisma.UserWhereUniqueInput>;
export const _UserWhereUniqueInputObjectSchema = Schema;
export const UserWhereUniqueInputObjectSchema: z.ZodType<Prisma.UserWhereUniqueInput> = Schema;
Keen for thoughts on this!
hi omar, thank you so much for this extremely helpful library! Is it possible for you to make it compatible with Prisma 5 as well?
Description
See #88 in reference to the issue. This implements the
satisfies
keyword for the type instead of inferring the zodType directly.With the above, you can now
References
Fixes #88. And a similar discussion in the zod repo.