-
-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
When using graphql-codegen-typescript-validation-schema together with Zod v4, the generated code produces type errors. The output still assumes the Zod v3 style where input and output types are identical, but in Zod v4 the generics are <Output, Def, Input>, so this no longer works.
Example error:
zod v4.1.5
graphql-codegen-typescript-validation-schema v0.17.1
lib/graphql/validation.ts:
plugins:
- typescript-validation-schema
config:
schema: zod
enumsAsTypes: true
strictScalars: false
useTypeImports: true
withObjectType: true
importFrom: './generated'
// from generated code
[K in keyof T]: z.ZodType<T[K], any, T[K]>;
// -> TS error about '$ZodTypeInternals'
This seems to be caused by the generated definitions not being updated for the Zod v4 type system.
Does anyone know the recommended solution or workaround for this issue?
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers