gqlts
gqlts copied to clipboard
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
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.