@@ -818,6 +818,9 @@ of rules must be adhered to by every Object type in a GraphQL schema.
818
818
characters {"__ "} (two underscores).
819
819
2 . The argument must accept a type where {IsInputType(argumentType)}
820
820
returns {true}.
821
+ 3 . If the argument has a default value, {defaultValue} must be compatible
822
+ with {argumentType} as per the coercion rules for that type, and
823
+ coercion of {defaultValue} must not cause an infinite loop.
821
824
3 . An object type may declare that it implements one or more unique interfaces.
822
825
4 . An object type must be a super-set of all interfaces it implements:
823
826
1 . Let this object type be {objectType}.
@@ -1520,10 +1523,11 @@ defined by the input object type and for which a value exists. The resulting map
1520
1523
is constructed with the following rules :
1521
1524
1522
1525
* If no value is provided for a defined input object field and that field
1523
- definition provides a default value , the default value should be used . If no
1524
- default value is provided and the input object field 's type is non -null , an
1525
- error should be thrown . Otherwise , if the field is not required , then no entry
1526
- is added to the coerced unordered map .
1526
+ definition provides a default value , the result of coercing the default value
1527
+ according to the coercion rules of the input field type should be used .
1528
+ If no default value is provided and the input object field 's type is
1529
+ non -null , an error should be thrown . Otherwise , if the field is not required ,
1530
+ then no entry is added to the coerced unordered map .
1527
1531
1528
1532
* If the value {null } was provided for an input object field , and the field 's
1529
1533
type is not a non -null type , an entry in the coerced unordered map is given
@@ -1580,6 +1584,9 @@ Literal Value | Variables | Coerced Value
1580
1584
characters {"__" } (two underscores).
1581
1585
3. The input field must accept a type where {IsInputType (inputFieldType)}
1582
1586
returns {true }.
1587
+ 4. If the input field has a default value , {defaultValue } must be compatible
1588
+ with {inputFieldType } as per the coercion rules for that type , and
1589
+ coercion of {defaultValue } must not cause an infinite loop .
1583
1590
3. If an Input Object references itself either directly or through referenced
1584
1591
Input Objects , at least one of the fields in the chain of references must be
1585
1592
either a nullable or a List type .
0 commit comments