Fix list coercion, variable usage validation and argument defaults - #908
Open
hugo-vrijswijk wants to merge 1 commit into
Open
Fix list coercion, variable usage validation and argument defaults#908hugo-vrijswijk wants to merge 1 commit into
hugo-vrijswijk wants to merge 1 commit into
Conversation
A non-list value is a valid input for a list type. Only literal lists were accepted, so `arg: [String]` rejected `"foo"` where the specification accepts it as `["foo"]`. A single value is now wrapped, recursively for nested lists, and `null` is left unwrapped. Default values pass through the same coercion, so a supplied value and an equal default no longer produce different results. A variable with no supplied value must fall back to the default of the location it fills. The default was applied to an absent argument only, not to an absent variable. A variable was also never compared with the type of the location where it is used. Value coercion rejected some incompatible usages as a side effect, and single value coercion removes that side effect. [Rule 5.8.5](https://spec.graphql.org/September2025/#sec-All-Variable-Usages-Are-Allowed) is now implemented directly. It covers field arguments, directive arguments, list entries and input object fields, in the operation and in every fragment it can reach. The rule also depends on the default value fix above, so the two cases which allow a nullable variable at a non-null location are now observable end to end. Five tests in `SkipIncludeSuite` and six in `VariablesSuite` declared a nullable variable at a non-null location. Those documents are invalid under rule 5.8.5, so the declarations are now non-null.
hugo-vrijswijk
force-pushed
the
fix/f8-single-value-list-coercion
branch
from
August 21, 2026 15:15
ee477a3 to
1b17643
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A non-list value is a valid input for a list type. Only literal lists were accepted, so
arg: [String]rejected"foo"where the specification accepts it as["foo"]. A single value is now wrapped, recursively for nested lists, andnullis left unwrapped. Default values pass through the same coercion, so a supplied value and an equal default no longer produce different results.A variable with no supplied value must fall back to the default of the location it fills. The default was applied to an absent argument only, not to an absent variable.
A variable was also never compared with the type of the location where it is used. Value coercion rejected some incompatible usages as a side effect, and single value coercion removes that side effect. Rule 5.8.5 is now implemented directly. It covers field arguments, directive arguments, list entries and input object fields, in the operation and in every fragment it can reach. The rule also depends on the default value fix above, so the two cases which allow a nullable variable at a non-null location are now observable end to end.
Five tests in
SkipIncludeSuiteand six inVariablesSuitedeclared a nullable variable at a non-null location. Those documents are invalid under rule 5.8.5, so the declarations are now non-null.