Avoid crash when oneOf input variable is not defined#4445
Avoid crash when oneOf input variable is not defined#4445JoviDeCroock wants to merge 1 commit into16.x.xfrom
Conversation
cd55555 to
8a16e93
Compare
| // If the variable definition is missing, skip validation here. | ||
| // This should be caught by other validation rules. | ||
| if (!definition) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
Technically "Values of Correct Type" in the spec only applies to literals ("For each literal Input Value {value} in the document:"), what you're actually dealing with here is maybe "All Variable Usages Are Allowed"?
But yes, I think in general the spec probably needs all of its validation rules to say "if doesn't exist, return" where that situation has already been covered by a different validation rule explicitly checking that X exists.
There was a problem hiding this comment.
In the spec, it looks like we touched up where the validation happened around the time of benjie/graphql-spec#1
In v17, it looks like we accomplished this in #4194
In v16, it looks like we touched up VariablesInAllowedPositions by #4363
So what remains to be done in v16 is to remove the variable bits entirely from ValuesOfCorrectType (created a branch to test around with this: https://github.com/yaacovCR/graphql-js/tree/alternative)
Pain points of multiple long-running development branches.... grumble, grumble
CC @benjie should this be added to the spec?
Fixes #4443