Open
Description
Hello, thanks for this codegen plugin!
However, I seem to have a problem with zod:
Given the GraphQL Schema e.g.:
input AppointmentInput {
description: String
...
(Optional String description)
The generated Schema is:
export function AppointmentInputSchema(): z.ZodObject<Properties<AppointmentInput>> {
return z.object({
description: z.string().nullish(),
this is giving me an error saying:
Type 'undefined' is not assignable to type 'InputMaybe'
The error goes away if I manually change it to:
...
description: z.string().nullable(),
...
( nullable instead of nullish)
My config is:
config: {
importFrom: "./schema",
withObjectType: true,
useTypeImports: true,
schema: "zod",
strictScalars: true,
}
Using:
"graphql-codegen-typescript-validation-schema": "^0.17.1"
"zod": "^3.24.4"