Support for non-input types?
markandrus opened this issue · 3 comments
I tried this out and, if I'm not mistaken, it only generates schemas (in my case, zod schemas) for input types. I would like to use this with non-input types as well (for example, to parse some JSON and ensure it adheres to the correct GraphQL type).
I would also greatly appreciate this. We have some generic functions that cache data returned from GQL queries, and want to make this as safe as possible, which entails parsing the cached data with zod before returning it. For this, we need auto-generated zod schemas for all generated query types.
@markandrus @efstajas Wouldn't withObjectType solve this?
graphql-codegen-typescript-validation-schema/tests/zod.spec.ts
Lines 765 to 808 in 3a49a55
I close this issue because inactive. Please open again if you need anything else.