Skip to content

Commit 7d86799

Browse files
committed
Clarify nested variable usages in Values of Correct Type
1 parent 7fe1b5a commit 7d86799

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

spec/Section 5 -- Validation.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,16 +1303,23 @@ fragment resourceFragment on Resource {
13031303

13041304
**Formal Specification**
13051305

1306-
- For each literal input Value {value} in the document:
1306+
- For each literal Input Value {value} in the document:
13071307
- Let {type} be the type expected in the position {value} is found.
1308-
- {value} must be coercible to {type}.
1308+
- {value} must be coercible to {type} (with the assumption that any
1309+
{variableUsage} nested within {value} will represent a runtime value of the
1310+
referenced variable's type).
13091311

13101312
**Explanatory Text**
13111313

13121314
Literal values must be compatible with the type expected in the position they
13131315
are found as per the coercion rules defined in the Type System chapter. Variable
13141316
values are handled by the rule
13151317
[All Variable Usages Are Allowed](#sec-All-Variable-Usages-Are-Allowed).
1318+
{ListValue} and {ObjectValue} may nest additional Input Values, some of which
1319+
may be a {variableUsage}. Each nested {variableUsage} will be coerced during
1320+
execution - see [Coercing Variable Values](#sec-Coercing-Variable-Values) - thus
1321+
we assume their runtime value will coerce to the type of the referenced
1322+
variable.
13161323

13171324
The type expected in a position includes the type defined by the argument a
13181325
value is provided for, the type defined by an input object field a value is

0 commit comments

Comments
 (0)