@@ -1638,9 +1638,9 @@ defined by the input object type and for which a value exists. The resulting map
1638
1638
is constructed with the following rules :
1639
1639
1640
1640
- If no value is provided for a defined input object field and that field
1641
- definition provides a default value , the default value should be used . If no
1641
+ definition provides a default value , the default value must be used . If no
1642
1642
default value is provided and the input object field 's type is non -null , an
1643
- error should be raised . Otherwise , if the field is not required , then no entry
1643
+ error must be raised . Otherwise , if the field is not required , then no entry
1644
1644
is added to the coerced unordered map .
1645
1645
1646
1646
- If the value {null } was provided for an input object field , and the field 's
@@ -1652,12 +1652,17 @@ is constructed with the following rules:
1652
1652
coerced unordered map is given the result of coercing that value according to
1653
1653
the input coercion rules for the type of that field .
1654
1654
1655
- - If a variable is provided for an input object field , the runtime value of that
1656
- variable must be used . If the runtime value is {null } and the field type is
1657
- non -null , a _field error_ must be raised . If no runtime value is provided , the
1658
- variable definition 's default value should be used . If the variable definition
1659
- does not provide a default value , the input object field definition 's default
1660
- value should be used .
1655
+ - If a variable is provided for an input object field :
1656
+
1657
+ - If the _coerced runtime value_ of that variable exists then it must be used .
1658
+ If the coerced runtime value is {null } and the field type is non -null , a
1659
+ _field error_ must be raised .
1660
+
1661
+ - If the _coerced runtime value_ of that variable does not exist then the
1662
+ input object field definition 's default value must be used . If no default
1663
+ value is provided and the input object field 's type is non -null , an error
1664
+ must be raised . Otherwise , if the field is not required , then no entry is
1665
+ added to the coerced unordered map .
1661
1666
1662
1667
Following are examples of input coercion for an input object type with a
1663
1668
`String ` field `a ` and a required (non-null) `Int !` field `b `:
@@ -1791,12 +1796,8 @@ CoerceListValue(value, listType):
1791
1796
CoerceListItemValue (itemValue, itemType):
1792
1797
1793
1798
- If {itemValue } is a Variable :
1794
- - If the variable provides a runtime value :
1795
- - Let {coercedItemValue } be the runtime value of the variable .
1796
- - Otherwise , if the variable definition provides a default value :
1797
- - Let {coercedItemValue } be this default value .
1798
- - Otherwise :
1799
- - Let {coercedItemValue } be {null }.
1799
+ - Let {coercedItemValue } be the _coerced runtime value_ of that variable , or
1800
+ {null } if no such value exists .
1800
1801
- If {coercedItemValue } is {null } and {itemType } is a non -null type , a _field
1801
1802
error_ must be raised .
1802
1803
- Return {coercedItemValue }.
0 commit comments