@@ -1638,9 +1638,9 @@ defined by the input object type and for which a value exists. The resulting map
16381638is constructed with the following rules :
16391639
16401640- 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
16421642 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
16441644 is added to the coerced unordered map .
16451645
16461646- 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:
16521652 coerced unordered map is given the result of coercing that value according to
16531653 the input coercion rules for the type of that field .
16541654
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 .
16611666
16621667Following are examples of input coercion for an input object type with a
16631668`String ` field `a ` and a required (non-null) `Int !` field `b `:
@@ -1791,12 +1796,8 @@ CoerceListValue(value, listType):
17911796CoerceListItemValue (itemValue, itemType):
17921797
17931798- 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 .
18001801 - If {coercedItemValue } is {null } and {itemType } is a non -null type , a _field
18011802 error_ must be raised .
18021803 - Return {coercedItemValue }.
0 commit comments