Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: implement typed Input/Output interface for resolvers #753

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

jorisre
Copy link
Member

@jorisre jorisre commented Feb 26, 2025

This PR implements typed Input/Output interfaces for resolvers, which needs react-hook-form/react-hook-form#12638

Next steps will involve extending this implementation to all applicable resolver modules.

Note: This PR will fail until the release of react-hook-form/react-hook-form#12638

Fixes #743

it('should correctly infer the output type from a zod schema when a different input type is specified (only input type is specified)', () => {
const resolver = zodResolver<{ id: string }>(z.object({ id: z.string() }));

expectTypeOf(resolver).toEqualTypeOf<
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kotarella1110 Confused why this test is failing while the previous one works fine. Could this be a TypeScript limitation?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zod resolver infered types are incorect since 4.1.0
1 participant