@@ -280,7 +280,7 @@ A GraphQL schema may describe that a field represents a list of another type;
280
280
the ` List ` type is provided for this reason, and wraps another type.
281
281
282
282
Similarly, the ` Non-Null ` type wraps another type, and denotes that the
283
- resulting value will never be {null} (and that an error cannot result in a
283
+ resulting value will never be {null} (and that a field error cannot result in a
284
284
{null} value).
285
285
286
286
These two types are referred to as "wrapping types"; non-wrapping types are
@@ -375,7 +375,8 @@ all built-in scalars must be omitted for brevity.
375
375
376
376
A GraphQL service, when preparing a field of a given scalar type, must uphold the
377
377
contract the scalar type describes, either by coercing the value or producing a
378
- field error if a value cannot be coerced or if coercion may result in data loss.
378
+ [ field error] ( #sec-Errors.Field-errors ) if a value cannot be coerced or if
379
+ coercion may result in data loss.
379
380
380
381
A GraphQL service may decide to allow coercing different internal types to the
381
382
expected return type. For example when coercing a field of type {Int} a boolean
@@ -399,7 +400,8 @@ information on the serialization of scalars in common JSON and other formats.
399
400
400
401
If a GraphQL service expects a scalar type as input to an argument, coercion
401
402
is observable and the rules must be well defined. If an input value does not
402
- match a coercion rule, a query error must be raised.
403
+ match a coercion rule, a [ request error] ( #sec-Errors.Request-errors ) must be
404
+ raised (input values are validated before execution begins).
403
405
404
406
GraphQL has different constant literals to represent integer and floating-point
405
407
input values, and coercion rules may apply differently depending on which type
@@ -438,10 +440,10 @@ greater than or equal to 2<sup>31</sup>, a field error should be raised.
438
440
** Input Coercion**
439
441
440
442
When expected as an input type, only integer input values are accepted. All
441
- other input values, including strings with numeric content, must raise a query
443
+ other input values, including strings with numeric content, must raise a request
442
444
error indicating an incorrect type. If the integer input value represents a
443
445
value less than -2<sup >31</sup > or greater than or equal to 2<sup >31</sup >, a
444
- query error should be raised.
446
+ request error should be raised.
445
447
446
448
Note: Numeric integer values larger than 32-bit should either use String or a
447
449
custom-defined Scalar type, as not all platforms and transports support
@@ -473,10 +475,10 @@ coerced to {Float} and must raise a field error.
473
475
When expected as an input type, both integer and float input values are
474
476
accepted. Integer input values are coerced to Float by adding an empty
475
477
fractional part, for example ` 1.0 ` for the integer input value ` 1 ` . All
476
- other input values, including strings with numeric content, must raise a query
478
+ other input values, including strings with numeric content, must raise a request
477
479
error indicating an incorrect type. If the input value otherwise represents a
478
480
value not representable by finite IEEE 754 (e.g. {NaN}, {Infinity}, or a value
479
- outside the available precision), a query error must be raised.
481
+ outside the available precision), a request error must be raised.
480
482
481
483
482
484
### String
@@ -498,7 +500,7 @@ string `"1"` for the integer `1`.
498
500
** Input Coercion**
499
501
500
502
When expected as an input type, only valid UTF-8 string input values are
501
- accepted. All other input values must raise a query error indicating an
503
+ accepted. All other input values must raise a request error indicating an
502
504
incorrect type.
503
505
504
506
@@ -519,7 +521,7 @@ this may include returning `true` for non-zero numbers.
519
521
** Input Coercion**
520
522
521
523
When expected as an input type, only boolean input values are accepted. All
522
- other input values must raise a query error indicating an incorrect type.
524
+ other input values must raise a request error indicating an incorrect type.
523
525
524
526
525
527
### ID
@@ -544,7 +546,7 @@ When coercion is not possible they must raise a field error.
544
546
When expected as an input type, any string (such as ` "4" ` ) or integer (such as
545
547
` 4 ` or ` -4 ` ) input value should be coerced to ID as appropriate for the ID
546
548
formats a given GraphQL service expects. Any other input value, including float
547
- input values (such as ` 4.0 ` ), must raise a query error indicating an incorrect
549
+ input values (such as ` 4.0 ` ), must raise a request error indicating an incorrect
548
550
type.
549
551
550
552
@@ -1386,7 +1388,7 @@ reasonable coercion is not possible they must raise a field error.
1386
1388
** Input Coercion**
1387
1389
1388
1390
GraphQL has a constant literal to represent enum input values. GraphQL string
1389
- literals must not be accepted as an enum input and instead raise a query error.
1391
+ literals must not be accepted as an enum input and instead raise a request error.
1390
1392
1391
1393
Query variable transport serializations which have a different representation
1392
1394
for non-string symbolic values (for example, [ EDN] ( https://github.com/edn-format/edn ) )
@@ -1514,10 +1516,10 @@ type of an Object or Interface field.
1514
1516
**Input Coercion **
1515
1517
1516
1518
The value for an input object should be an input object literal or an unordered
1517
- map supplied by a variable , otherwise a query error must be thrown . In either
1519
+ map supplied by a variable , otherwise a request error must be raised . In either
1518
1520
case , the input object literal or unordered map must not contain any entries
1519
- with names not defined by a field of this input object type , otherwise an error
1520
- must be thrown .
1521
+ with names not defined by a field of this input object type , otherwise a
1522
+ response error must be raised .
1521
1523
1522
1524
The result of coercion is an unordered map with an entry for each field both
1523
1525
defined by the input object type and for which a value exists . The resulting map
@@ -1526,7 +1528,7 @@ is constructed with the following rules:
1526
1528
* If no value is provided for a defined input object field and that field
1527
1529
definition provides a default value , the default value should be used . If no
1528
1530
default value is provided and the input object field 's type is non -null , an
1529
- error should be thrown . Otherwise , if the field is not required , then no entry
1531
+ error should be raised . Otherwise , if the field is not required , then no entry
1530
1532
is added to the coerced unordered map .
1531
1533
1532
1534
* If the value {null } was provided for an input object field , and the field 's
@@ -1540,7 +1542,7 @@ is constructed with the following rules:
1540
1542
1541
1543
* If a variable is provided for an input object field , the runtime value of that
1542
1544
variable must be used . If the runtime value is {null } and the field type
1543
- is non -null , a field error must be thrown . If no runtime value is provided ,
1545
+ is non -null , a field error must be raised . If no runtime value is provided ,
1544
1546
the variable definition 's default value should be used . If the variable
1545
1547
definition does not provide a default value , the input object field
1546
1548
definition 's default value should be used .
@@ -1632,12 +1634,12 @@ implementation.
1632
1634
1633
1635
If a list 's item type is nullable , then errors occurring during preparation or
1634
1636
coercion of an individual item in the list must result in a the value {null } at
1635
- that position in the list along with an error added to the response . If a list ' s
1636
- item type is non -null , an error occurring at an individual item in the list must
1637
- result in a field error for the entire list .
1637
+ that position in the list along with a field error added to the response .
1638
+ If a list ' s item type is non -null , a field error occurring at an individual item
1639
+ in the list must result in a field error for the entire list .
1638
1640
1639
- Note : For more information on the error handling process , see "Errors and
1640
- Non-Nullability" within the Execution section .
1641
+ Note : See [ Handling Field Errors ]( #sec-Handling-Field-Errors) for more about
1642
+ this behavior .
1641
1643
1642
1644
**Input Coercion**
1643
1645
@@ -1706,7 +1708,7 @@ the parent field. For more information on this process, see
1706
1708
If an argument or input -object field of a Non -Null type is not provided , is
1707
1709
provided with the literal value {null }, or is provided with a variable that was
1708
1710
either not provided a value at runtime , or was provided the value {null }, then
1709
- a query error must be raised .
1711
+ a request error must be raised .
1710
1712
1711
1713
If the value provided to the Non -Null type is provided with a literal value
1712
1714
other than {null }, or a Non -Null variable value , it is coerced using the input
0 commit comments