Skip to content

Commit 8efb84c

Browse files
committed
Exclude custom scalar literals from validation
1 parent 1f690d4 commit 8efb84c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

+9-3
Original file line numberDiff line numberDiff line change
@@ -1306,9 +1306,10 @@ fragment resourceFragment on Resource {
13061306

13071307
- 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} (with the assumption that any
1310-
{variableUsage} nested within {value} will represent a runtime value valid
1311-
for usage in its position).
1309+
- If {type} is not a custom scalar type:
1310+
- {value} must be coercible to {type} (with the assumption that any
1311+
{variableUsage} nested within {value} will represent a runtime value valid
1312+
for usage in its position).
13121313

13131314
**Explanatory Text**
13141315

@@ -1324,6 +1325,11 @@ algorithm ensures runtime values for variables coerce correctly. Therefore, for
13241325
the purposes of the "coercible" assertion in this validation rule, we can assume
13251326
the runtime value of each {variableUsage} is valid for usage in its position.
13261327

1328+
Note: Custom scalar coercion rules are not always available when validating a
1329+
document and custom scalar literal values are excluded from this validation. If
1330+
a custom scalar literal value cannot be coerced, it will raise an execution
1331+
error.
1332+
13271333
The type expected in a position includes the type defined by the argument a
13281334
value is provided for, the type defined by an input object field a value is
13291335
provided for, and the type of a variable definition a default value is provided

0 commit comments

Comments
 (0)