Is there a way to append a transform to a zod schema? #1229
Unanswered
Greg-Freeman
asked this question in
Q&A
Replies: 1 comment 1 reply
-
In Kubb you can use 'parser' to use Zod in react-query: https://www.kubb.dev/plugins/swagger-tanstack-query/#parser. Could that help out or is more needed? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently we receive DTO's that we need to reshape and we would like to define zod transforms on the end of the schema to map between objects, and have the resulting type used in react query instead. Is there any way to do that, or would we need to use templates if we wanted it part of the automated generation?
Effectively i want something like this pseudo code to be output
getPetByIdQueryResponseSchema.transform(petDTO=> pet).parse() where pet is stored in the react query cache instead of petDTO
Beta Was this translation helpful? Give feedback.
All reactions