@@ -1447,6 +1447,57 @@ define arguments or contain references to interfaces and unions, neither of
1447
1447
which is appropriate for use as an input argument . For this reason , input
1448
1448
objects have a separate type in the system .
1449
1449
1450
+ **Circular References **
1451
+
1452
+ Input Objects are allowed to reference other Input Objects . A circular reference
1453
+ occurs when an Input Object references itself either directly or through
1454
+ referenced Input Objects .
1455
+
1456
+ Circular references are generally allowed , however they may not be defined as an
1457
+ unbroken chain of Non -Null fields . Such Input Objects are invalid , because there
1458
+ is no way to provide a legal value for them .
1459
+
1460
+ The following examples are allowed :
1461
+
1462
+ ```graphql example
1463
+ input Example {
1464
+ self : Example
1465
+ value : String
1466
+ }
1467
+ ```
1468
+
1469
+ This is fine because a value for `self ` may simply be omitted from the arguments .
1470
+
1471
+ ```graphql example
1472
+ input Example {
1473
+ self : [Example ! ]!
1474
+ value : String
1475
+ }
1476
+ ```
1477
+
1478
+ This also works as `self ` can just contain an empty list .
1479
+
1480
+ The following examples are invalid :
1481
+
1482
+ ```graphql counter -example
1483
+ input Example {
1484
+ value : String
1485
+ self : Example !
1486
+ }
1487
+ ```
1488
+
1489
+ ```graphql counter -example
1490
+ input First {
1491
+ second : Second !
1492
+ value : String
1493
+ }
1494
+
1495
+ input Second {
1496
+ first : First !
1497
+ value : String
1498
+ }
1499
+ ```
1500
+
1450
1501
**Result Coercion **
1451
1502
1452
1503
An input object is never a valid result . Input Object types cannot be the return
@@ -1525,6 +1576,9 @@ Literal Value | Variables | Coerced Value
1525
1576
characters {"__" } (two underscores).
1526
1577
3. The input field must accept a type where {IsInputType (inputFieldType)}
1527
1578
returns {true }.
1579
+ 3. If an Input Object references itself either directly or through referenced
1580
+ Input Objects , at least one of the fields in the chain of references must be
1581
+ either nullable or a List .
1528
1582
1529
1583
1530
1584
### Input Object Extensions
0 commit comments