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 @@ -1890,7 +1890,8 @@ variable.
1890
1890
1891
1891
IsVariableUsageAllowed(variableDefinition, variableUsage):
1892
1892
1893
- - If {variableUsage} is nested in a custom scalar literal value, return {true}.
1893
+ - If {variableUsage} is nested within a custom scalar literal value, return
1894
+ {true}.
1894
1895
- Let {variableType} be the expected type of {variableDefinition}.
1895
1896
- Let {locationType} be the expected type of the {Argument}, {ObjectField}, or
1896
1897
{ListValue} entry where {variableUsage} is located.
@@ -1981,6 +1982,19 @@ query nonNullListToList($nonNullBooleanList: [Boolean]!) {
1981
1982
}
1982
1983
```
1983
1984
1985
+ When using variables nested within custom scalars literals, the expected type is
1986
+ unknown, and variable usages are always allowed. The actual value is coerced at
1987
+ runtime using the custom scalar coercion rules. In the following case, the
1988
+ ` user ` argument expects a ` JSON ` custom scalar, and it is valid for it to
1989
+ reference variables:
1990
+
1991
+ ``` graphql example
1992
+ mutation updateUserName ($name : String ! ) {
1993
+ # This usage of the $name variable is valid
1994
+ updateUser (user : { name : $name })
1995
+ }
1996
+ ```
1997
+
1984
1998
However, a nullable list cannot be passed to a non-null list:
1985
1999
1986
2000
``` graphql counter-example
You can’t perform that action at this time.
0 commit comments