File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1873,7 +1873,8 @@ variable.
1873
1873
1874
1874
IsVariableUsageAllowed(variableDefinition, variableUsage):
1875
1875
1876
- - If {variableUsage} is nested in a custom scalar literal value, return {true}.
1876
+ - If {variableUsage} is nested within a custom scalar literal value, return
1877
+ {true}.
1877
1878
- Let {variableType} be the expected type of {variableDefinition}.
1878
1879
- Let {locationType} be the expected type of the {Argument}, {ObjectField}, or
1879
1880
{ListValue} entry where {variableUsage} is located.
@@ -1964,6 +1965,19 @@ query nonNullListToList($nonNullBooleanList: [Boolean]!) {
1964
1965
}
1965
1966
```
1966
1967
1968
+ When using variables nested within custom scalars literals, the expected type is
1969
+ unknown, and variable usages are always allowed. The actual value is coerced at
1970
+ runtime using the custom scalar coercion rules. In the following case, the
1971
+ ` user ` argument expects a ` JSON ` custom scalar, and it is valid for it to
1972
+ reference variables:
1973
+
1974
+ ``` graphql example
1975
+ mutation updateUserName ($name : String ! ) {
1976
+ # This usage of the $name variable is valid
1977
+ updateUser (user : { name : $name })
1978
+ }
1979
+ ```
1980
+
1967
1981
However, a nullable list cannot be passed to a non-null list:
1968
1982
1969
1983
``` graphql counter-example
You can’t perform that action at this time.
0 commit comments