You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having a strange issue where generated input Schema generates Zod objects in the wrong order, resulting in a "is used before being assigned" error.
and of course, because ProvisionParamSchema is referenced before its defined, an error is thrown.
Is there a reason for why this is happening? It seems to only be happening after updating graphql-codegen-typescript-validation-schema to keep up-to-date with me updating @graphql-codegen package.
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered:
Update:
It seems that 0.11.0 has a bug in it where generated Schemas can be out of order, as mentioned above.
I was able to get it working simply by downgrading to version 0.10.0.
Sorry, I omitted to reply. Does this problem still occur?
If it does occur, it would be appreciated if you could provide a minimum reproduction, e.g. using codesandbox.
Hi @Code-Hex, I confirm in version 1.16.0 the problem is still present. Switching to validationSchemaExportType: 'function' solves the problem but with const the problem persists. I try to give you a repro.
I am having a strange issue where generated input Schema generates Zod objects in the wrong order, resulting in a "is used before being assigned" error.
Server Setup
package.json:
codegen.yml:
...with relevant part of my GraphQL schema:
Given the above, the generated code appears as such:
and of course, because
ProvisionParamSchema
is referenced before its defined, an error is thrown.Is there a reason for why this is happening? It seems to only be happening after updating
graphql-codegen-typescript-validation-schema
to keep up-to-date with me updating@graphql-codegen
package.Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: