-
-
Notifications
You must be signed in to change notification settings - Fork 57
Support for Zod 4 #1184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Support for Zod 4 #1184
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Zod v4 to the GraphQL Code Generator validation schema plugin. The implementation introduces a new zodv4
schema type with updated type definitions and enum handling compatible with Zod v4, while providing backward compatibility through a new zodImportPath
configuration option.
Key Changes
- Added
zodv4
schema type with updated type system for Zod v4 compatibility - Introduced
zodImportPath
configuration option for custom Zod import paths (e.g.,zod/v3
compatibility layer) - Fixed a type error in the YUP implementation for better enum handling
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/zodv4/index.ts | New ZodV4SchemaVisitor implementation with updated Properties type and enum handling |
src/index.ts | Registers the new zodv4 schema visitor |
src/config.ts | Adds zodv4 to ValidationSchema type and zodImportPath config option |
src/zod/index.ts | Implements zodImportPath configuration for custom Zod imports |
src/yup/index.ts | Fixes type error in enum name resolution |
tests/zodv4.spec.ts | Comprehensive test suite covering all zodv4 functionality |
tests/zod.spec.ts | Tests for zodImportPath configuration |
package.json | Adds Zod peer dependency and zodv4 type checking script |
@Code-Hex any news on this? |
Would love to see it merged 🙏 |
any chance of merge? |
this repo probably abandoned? |
I have added support for zod v4.
#1044
I have also added support for the following I have added support for