We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If a type has a property of an interface (InterfaceTypeDefinition), the Zod (have not tried others) schema generation will fail.
interface Animal { } type Dog implements Animal { } type Cat implements Animal { } type Something { animal: Animal }
The current workaround is adding the interface as a scalar
scalarSchemas: Animal: z.unknown()
Another workaround is modifying the GQL schema (not preferred):
Same logic as ZodSchemaVisitor.ObjectTypeDefinition but remove the addition of __typename (since an interface has no typename)
ZodSchemaVisitor.ObjectTypeDefinition
The text was updated successfully, but these errors were encountered:
@simonljus Hi 👋 Thanks for made this issue.
Could you give me PR for this fix?
Sorry, something went wrong.
@simonljus Hi 👋 Thanks for made this issue. Could you give me PR for this fix?
Hi Code-Hex Yes I will try, see #530
No branches or pull requests
Description
If a type has a property of an interface (InterfaceTypeDefinition), the Zod (have not tried others) schema generation will fail.
Workaround
The current workaround is adding the interface as a scalar
Another workaround is modifying the GQL schema (not preferred):
Suggestion
Same logic as
ZodSchemaVisitor.ObjectTypeDefinition
but remove the addition of __typename (since an interface has no typename)The text was updated successfully, but these errors were encountered: