[QUESTION]: nonOptionalTypename: supported?
smakinson opened this issue · 5 comments
smakinson commented
Hi, Is it expected that using:
config: {
...
nonOptionalTypename: true,
schema: 'zod',
}
should prevent .optional() from being applied to __typename? It does not seem to do this when giving it a try.
Code-Hex commented
@smakinson Could you give me more context because I'm not sure why don't you need __typename?
Code-Hex commented
no reply.
Open again if you need anything else.
btoo commented
@Code-Hex for some projects, __typename plays a critical enough role (e.g. for discriminated unions) that graphql-codegen allows automatically including it in the generated typescript, even if it wasnt explicitly requested in the graphql document
it would be nice if typescript-validation-schema respected / had a consistent api with this configuration
edit: i got a head start on supporting nonOptionalTypename in 2822c7c