-
Notifications
You must be signed in to change notification settings - Fork 7
feat(zod): Adapt to Zod v4 #41
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
Conversation
|
Support for Zod v4 is included in Install using the # Using npm
npm install zod@next @gqloom/zod@next
# Using yarn
yarn add zod@next @gqloom/zod@next
# Using pnpm
pnpm add zod@next @gqloom/zod@next |
|
This PR is planned to be merged after Zod v4 is released as the main version. |
|
This looks great! |
|
Update: the Here's a dedicated guide for library authors that answers some common questions: https://v4.zod.dev/library-authors
|
- Bumped version of @gqloom/core from 0.9.0 to 0.9.1 and @gqloom/drizzle from 0.9.1 to 0.9.3 in pnpm-lock.yaml. - Updated zod dependency to version 3.25.17 in package.json and adjusted peer dependencies accordingly. - Changed module resolution strategy in tsconfig.json from "node" to "bundler". - Refactored imports in zod package files to use the new zod version structure.
- Introduced ZodWeaver class to facilitate the conversion of Zod schemas into GraphQL types. - Added utility functions for handling object, field, enum, and union types in GraphQL. - Implemented metadata registration functions for GraphQL object types and fields. - Enhanced type safety and integration with GraphQL by defining various configuration interfaces. - Added comprehensive tests to validate the functionality of the ZodWeaver and its utilities.
- Updated getGraphQLType method to handle both v4 and v3 Zod schemas. - Added a test case to validate the integration of v3 schema handling. - Refactored printZodSilk function to improve type safety with updated parameter types.
- Introduced separate entry points for v3 schemas in package.json to support v3 module imports. - Updated tsup configuration to include v3 source file for building, enhancing modularity and compatibility.
- Changed zod dependency version from 4.0.0-beta to 3.25.17 in package.json and pnpm-lock.yaml. - Updated installation instructions in both English and Chinese documentation to reflect the new zod version. - Removed references to the beta version and adjusted related code snippets for consistency with the stable version.
No description provided.