Skip to content

Commit 1f690d4

Browse files
authored
Clarify 'Values of Correct Type' rule relates to literals (#1118)
* Clarify 'Values of Correct Type' rule does not apply to variables. * Clarify nested variable usages in Values of Correct Type * Change from referenced variable's type to suitable usage in its position * Further editing * The assumption is only valid locally. * coercibility -> coercible to pass spell check
1 parent a1884bb commit 1f690d4

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Diff for: spec/Section 5 -- Validation.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -1304,15 +1304,26 @@ fragment resourceFragment on Resource {
13041304

13051305
**Formal Specification**
13061306

1307-
- For each input Value {value} in the document:
1307+
- For each literal Input Value {value} in the document:
13081308
- Let {type} be the type expected in the position {value} is found.
1309-
- {value} must be coercible to {type}.
1309+
- {value} must be coercible to {type} (with the assumption that any
1310+
{variableUsage} nested within {value} will represent a runtime value valid
1311+
for usage in its position).
13101312

13111313
**Explanatory Text**
13121314

13131315
Literal values must be compatible with the type expected in the position they
13141316
are found as per the coercion rules defined in the Type System chapter.
13151317

1318+
Note: A {ListValue} or {ObjectValue} may contain nested Input Values, some of
1319+
which may be a variable usage. The
1320+
[All Variable Usages Are Allowed](#sec-All-Variable-Usages-Are-Allowed)
1321+
validation rule ensures that each {variableUsage} is of a type allowed in its
1322+
position. The [Coercing Variable Values](#sec-Coercing-Variable-Values)
1323+
algorithm ensures runtime values for variables coerce correctly. Therefore, for
1324+
the purposes of the "coercible" assertion in this validation rule, we can assume
1325+
the runtime value of each {variableUsage} is valid for usage in its position.
1326+
13161327
The type expected in a position includes the type defined by the argument a
13171328
value is provided for, the type defined by an input object field a value is
13181329
provided for, and the type of a variable definition a default value is provided

0 commit comments

Comments
 (0)