Skip to content
New issue

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

When using generated types from an external schema, if a mutation accepts a type argument that is allocated the ID of 0, an error will occur #771

Open
AlexBksiad opened this issue Nov 12, 2023 · 1 comment

Comments

@AlexBksiad
Copy link
Contributor

Currently if a type or scalar is assigned to identifier 0 in the generated types.cjs.js file, it will be present and available in the generated types, but at runtime when attempting to use any mutation with an argument of this type, you will get an error:

Error: no typing defined for argument argumentFieldName in path mutationType.

This is because during generation of the runtime linked type map, the check for a missing argTypeName does not take into account the possibility of an argTypeName of 0 being used as a mutation argument. This is commonly the case in relation to the ID scalar - generally being the first scalar and therefore being assigned the argTypeName of 0.


I have raised PR 762 to resolve this.

@meabed
Copy link
Owner

meabed commented Nov 12, 2023

Thank you @AlexBksiad for fixing it, will merge this shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants