But its getting this error:
Type 'ZodObject<{ equals: ZodOptional<ZodString>; in: ZodOptional<ZodUnion<[ZodArray<ZodString, "many">, ZodString]>>; ... 8 more ...; not: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>' is not assignable to type 'ZodType<StringFilter<never>, ZodTypeDef, StringFilter<never>>'. The types of '_type.in' are incompatible between these types. Type 'string | string[] | undefined' is not assignable to type 'string[] | undefined'. Type 'string' is not assignable to type 'string[]'.ts(2322)
If i change the lines of in and notIn to this it works fine: z.string().array().optional()
I have similar issues on a few types, (date and field realted), and I think that's because we are using Prisma V5.X which is not supported by this library atm
Bug description
I just generated all the stuff with the "withZod" flag and th StringFilter.schema.ts file resulted like this:
But its getting this error:
Type 'ZodObject<{ equals: ZodOptional<ZodString>; in: ZodOptional<ZodUnion<[ZodArray<ZodString, "many">, ZodString]>>; ... 8 more ...; not: ZodOptional<...>; }, "strict", ZodTypeAny, { ...; }, { ...; }>' is not assignable to type 'ZodType<StringFilter<never>, ZodTypeDef, StringFilter<never>>'. The types of '_type.in' are incompatible between these types. Type 'string | string[] | undefined' is not assignable to type 'string[] | undefined'. Type 'string' is not assignable to type 'string[]'.ts(2322)
If i change the lines of in and notIn to this it works fine:
z.string().array().optional()
How to reproduce
Generate the prisma files of any Module.
"prisma-trpc-generator": "^1.4.1", "@prisma/client": "^5.1.1", "@trpc/client": "^10.34.0",
Expected behavior
To no have any type error
Prisma information
Environment & setup
"prisma-trpc-generator": "^1.4.1", "@prisma/client": "^5.1.1", "@trpc/client": "^10.34.0",
Prisma Version