File tree 1 file changed +50
-4
lines changed 1 file changed +50
-4
lines changed Original file line number Diff line number Diff line change @@ -1360,11 +1360,57 @@ Literal Value | Variables | Coerced Value
1360
1360
1361
1361
**Type Validation **
1362
1362
1363
- 1. An Input Object type must define one or more input fields .
1364
- 2. The fields of an Input Object type must have unique names within that
1365
- Input Object type ; no two fields may share the same name .
1366
- 3. The return types of each defined field must be an Input type .
1363
+ * An Input Object type must define one or more input fields .
1364
+ * The fields of an Input Object type must have unique names within that
1365
+ Input Object type ; no two fields may share the same name .
1366
+ * The return types of each defined field must be an Input type .
1367
1367
1368
+ Input Objects are generally allowed to reference other Input Objects , even itself .
1369
+ If an Input Object references itself either directly or through subordinated
1370
+ Input Objects , one of the fields in the chain of references must be either nullable
1371
+ or a list . Input Objects with non -nullable circular references are invalid , because there
1372
+ is no way to provide a legal value for them .
1373
+
1374
+ The following examples are allowed :
1375
+
1376
+ ```graphql example
1377
+ input Example {
1378
+ value : String
1379
+ self : Example
1380
+ }
1381
+ ```
1382
+
1383
+ This is fine because `self ` may simply omitted at any point in the chain .
1384
+
1385
+ ```graphql example
1386
+ input Example {
1387
+ value : String
1388
+ self : [Example ! ]!
1389
+ }
1390
+ ```
1391
+
1392
+ This also works as `self ` can just contain an empty list .
1393
+
1394
+ The following examples are invalid :
1395
+
1396
+ ```graphql counter -example
1397
+ input Example {
1398
+ value : String
1399
+ self : Example !
1400
+ }
1401
+ ```
1402
+
1403
+ ```graphql counter -example
1404
+ input First {
1405
+ second : Second !
1406
+ string : String
1407
+ }
1408
+
1409
+ input Second {
1410
+ second : Second !
1411
+ string : String
1412
+ }
1413
+ ```
1368
1414
1369
1415
### Input Object Extensions
1370
1416
You can’t perform that action at this time.
0 commit comments