@@ -300,8 +300,8 @@ A GraphQL schema may describe that a field represents a list of another type;
300
300
the ` List ` type is provided for this reason, and wraps another type.
301
301
302
302
Similarly, the ` Non-Null ` type wraps another type, and denotes that the
303
- resulting value will never be {null} (and that a field error cannot result in a
304
- {null} value).
303
+ resulting value will never be {null} (and that a _ field error _ cannot result in
304
+ a {null} value).
305
305
306
306
These two types are referred to as "wrapping types"; non-wrapping types are
307
307
referred to as "named types". A wrapping type has an underlying named type,
@@ -425,14 +425,14 @@ examples in their description.
425
425
426
426
A GraphQL service , when preparing a field of a given scalar type , must uphold
427
427
the contract the scalar type describes , either by coercing the value or
428
- producing a [ field error ]( #sec-Errors.Field-errors) if a value cannot be coerced
429
- or if coercion may result in data loss.
428
+ producing a _field error_ if a value cannot be coerced or if coercion may result
429
+ in data loss .
430
430
431
431
A GraphQL service may decide to allow coercing different internal types to the
432
432
expected return type . For example when coercing a field of type {Int} a boolean
433
433
{true } value may produce {1} or a string value {"123" } may be parsed as base -10
434
434
{123}. However if internal type coercion cannot be reasonably performed without
435
- losing information, then it must raise a field error .
435
+ losing information , then it must raise a _field error_ .
436
436
437
437
Since this coercion behavior is not observable to clients of the GraphQL
438
438
service , the precise rules of coercion are left to the implementation . The only
@@ -450,8 +450,8 @@ information on the serialization of scalars in common JSON and other formats.
450
450
451
451
If a GraphQL service expects a scalar type as input to an argument, coercion is
452
452
observable and the rules must be well defined. If an input value does not match
453
- a coercion rule, a [request error]( #sec-Errors.Request-errors) must be raised
454
- (input values are validated before execution begins).
453
+ a coercion rule, a _request error_ must be raised ( input values are validated
454
+ before execution begins ).
455
455
456
456
GraphQL has different constant literals to represent integer and floating -point
457
457
input values , and coercion rules may apply differently depending on which type
@@ -477,22 +477,23 @@ Fields returning the type {Int} expect to encounter 32-bit integer internal
477
477
values .
478
478
479
479
GraphQL services may coerce non -integer internal values to integers when
480
- reasonable without losing information , otherwise they must raise a field error .
481
- Examples of this may include returning `1` for the floating -point number `1.0`,
482
- or returning `123` for the string `"123" `. In scenarios where coercion may lose
483
- data , raising a field error is more appropriate . For example , a floating -point
484
- number `1.2` should raise a field error instead of being truncated to `1`.
480
+ reasonable without losing information , otherwise they must raise a _field
481
+ error_ . Examples of this may include returning `1` for the floating -point number
482
+ `1.0`, or returning `123` for the string `"123" `. In scenarios where coercion
483
+ may lose data , raising a field error is more appropriate . For example , a
484
+ floating -point number `1.2` should raise a field error instead of being
485
+ truncated to `1`.
485
486
486
487
If the integer internal value represents a value less than -2<sup >31</sup > or
487
- greater than or equal to 2<sup >31</sup >, a field error should be raised .
488
+ greater than or equal to 2<sup >31</sup >, a _field error_ should be raised .
488
489
489
490
**Input Coercion **
490
491
491
492
When expected as an input type , only integer input values are accepted . All
492
493
other input values , including strings with numeric content , must raise a request
493
494
error indicating an incorrect type . If the integer input value represents a
494
495
value less than -2<sup >31</sup > or greater than or equal to 2<sup >31</sup >, a
495
- request error should be raised .
496
+ _request error_ should be raised .
496
497
497
498
Note : Numeric integer values larger than 32-bit should either use String or a
498
499
custom -defined Scalar type , as not all platforms and transports support encoding
@@ -511,22 +512,22 @@ Fields returning the type {Float} expect to encounter double-precision
511
512
floating -point internal values .
512
513
513
514
GraphQL services may coerce non -floating -point internal values to {Float } when
514
- reasonable without losing information , otherwise they must raise a field error .
515
- Examples of this may include returning `1.0` for the integer number `1`, or
516
- `123.0` for the string `"123" `.
515
+ reasonable without losing information , otherwise they must raise a _field
516
+ error_ . Examples of this may include returning `1.0` for the integer number `1`,
517
+ or `123.0` for the string `"123" `.
517
518
518
519
Non -finite floating -point internal values ({NaN} and {Infinity}) cannot be
519
- coerced to {Float } and must raise a field error .
520
+ coerced to {Float } and must raise a _field error_ .
520
521
521
522
**Input Coercion **
522
523
523
524
When expected as an input type , both integer and float input values are
524
525
accepted . Integer input values are coerced to Float by adding an empty
525
526
fractional part , for example `1.0` for the integer input value `1`. All other
526
- input values , including strings with numeric content , must raise a request error
527
- indicating an incorrect type . If the input value otherwise represents a value
528
- not representable by finite IEEE 754 (e.g. {NaN}, {Infinity}, or a value outside
529
- the available precision), a request error must be raised .
527
+ input values , including strings with numeric content , must raise a _request
528
+ error_ indicating an incorrect type . If the input value otherwise represents a
529
+ value not representable by finite IEEE 754 (e.g. {NaN}, {Infinity}, or a value
530
+ outside the available precision), a _request error_ must be raised .
530
531
531
532
### String
532
533
@@ -542,14 +543,14 @@ that representation must be used to serialize this type.
542
543
Fields returning the type {String} expect to encounter Unicode string values .
543
544
544
545
GraphQL services may coerce non -string raw values to {String } when reasonable
545
- without losing information , otherwise they must raise a field error . Examples of
546
- this may include returning the string `"true" ` for a boolean true value , or the
547
- string `"1" ` for the integer `1`.
546
+ without losing information , otherwise they must raise a _field error_ . Examples
547
+ of this may include returning the string `"true" ` for a boolean true value , or
548
+ the string `"1" ` for the integer `1`.
548
549
549
550
**Input Coercion **
550
551
551
552
When expected as an input type , only valid Unicode string input values are
552
- accepted . All other input values must raise a request error indicating an
553
+ accepted . All other input values must raise a _request error_ indicating an
553
554
incorrect type .
554
555
555
556
### Boolean
@@ -563,13 +564,13 @@ representation of the integers `1` and `0`.
563
564
Fields returning the type {Boolean} expect to encounter boolean internal values .
564
565
565
566
GraphQL services may coerce non -boolean raw values to {Boolean } when reasonable
566
- without losing information , otherwise they must raise a field error . Examples of
567
- this may include returning `true ` for non -zero numbers .
567
+ without losing information , otherwise they must raise a _field error_ . Examples
568
+ of this may include returning `true ` for non -zero numbers .
568
569
569
570
**Input Coercion **
570
571
571
572
When expected as an input type , only boolean input values are accepted . All
572
- other input values must raise a request error indicating an incorrect type .
573
+ other input values must raise a _request error_ indicating an incorrect type .
573
574
574
575
### ID
575
576
@@ -586,15 +587,15 @@ large 128-bit random numbers, to base64 encoded values, or string values of a
586
587
format like [GUID ](https ://en .wikipedia .org /wiki /Globally_unique_identifier ).
587
588
588
589
GraphQL services should coerce as appropriate given the ID formats they expect .
589
- When coercion is not possible they must raise a field error .
590
+ When coercion is not possible they must raise a _field error_ .
590
591
591
592
**Input Coercion **
592
593
593
594
When expected as an input type , any string (such as `"4" `) or integer (such as
594
595
`4` or `-4`) input value should be coerced to ID as appropriate for the ID
595
596
formats a given GraphQL service expects . Any other input value , including float
596
- input values (such as `4.0`), must raise a request error indicating an incorrect
597
- type .
597
+ input values (such as `4.0`), must raise a _request error_ indicating an
598
+ incorrect type .
598
599
599
600
### Scalar Extensions
600
601
@@ -1448,7 +1449,7 @@ enum Direction {
1448
1449
**Result Coercion **
1449
1450
1450
1451
GraphQL services must return one of the defined set of possible values . If a
1451
- reasonable coercion is not possible they must raise a field error .
1452
+ reasonable coercion is not possible they must raise a _field error_ .
1452
1453
1453
1454
**Input Coercion **
1454
1455
@@ -1584,9 +1585,9 @@ type of an Object or Interface field.
1584
1585
**Input Coercion **
1585
1586
1586
1587
The value for an input object should be an input object literal or an unordered
1587
- map supplied by a variable , otherwise a request error must be raised . In either
1588
- case , the input object literal or unordered map must not contain any entries
1589
- with names not defined by a field of this input object type , otherwise a
1588
+ map supplied by a variable , otherwise a _request error_ must be raised . In
1589
+ either case , the input object literal or unordered map must not contain any
1590
+ entries with names not defined by a field of this input object type , otherwise a
1590
1591
response error must be raised .
1591
1592
1592
1593
The result of coercion is an unordered map with an entry for each field both
@@ -1610,7 +1611,7 @@ is constructed with the following rules:
1610
1611
1611
1612
- If a variable is provided for an input object field , the runtime value of that
1612
1613
variable must be used . If the runtime value is {null } and the field type is
1613
- non -null , a field error must be raised . If no runtime value is provided , the
1614
+ non -null , a _field error_ must be raised . If no runtime value is provided , the
1614
1615
variable definition 's default value should be used . If the variable definition
1615
1616
does not provide a default value , the input object field definition 's default
1616
1617
value should be used .
@@ -1698,13 +1699,14 @@ brackets like this: `pets: [Pet]`. Nesting lists is allowed: `matrix: [[Int]]`.
1698
1699
1699
1700
GraphQL services must return an ordered list as the result of a list type . Each
1700
1701
item in the list must be the result of a result coercion of the item type . If a
1701
- reasonable coercion is not possible it must raise a field error . In particular ,
1702
- if a non -list is returned , the coercion should fail , as this indicates a
1703
- mismatch in expectations between the type system and the implementation .
1702
+ reasonable coercion is not possible it must raise a _field error_ . In
1703
+ particular , if a non -list is returned , the coercion should fail , as this
1704
+ indicates a mismatch in expectations between the type system and the
1705
+ implementation .
1704
1706
1705
1707
If a list 's item type is nullable , then errors occurring during preparation or
1706
1708
coercion of an individual item in the list must result in a the value {null } at
1707
- that position in the list along with a field error added to the response . If a
1709
+ that position in the list along with a _field error_ added to the response . If a
1708
1710
list 's item type is non -null , a field error occurring at an individual item in
1709
1711
the list must result in a field error for the entire list .
1710
1712
@@ -1764,19 +1766,20 @@ always optional and non-null types are always required.
1764
1766
In all of the above result coercions , {null } was considered a valid value . To
1765
1767
coerce the result of a Non -Null type , the coercion of the wrapped type should be
1766
1768
performed . If that result was not {null }, then the result of coercing the
1767
- Non -Null type is that result . If that result was {null }, then a field error must
1768
- be raised .
1769
+ Non -Null type is that result . If that result was {null }, then a _field error_
1770
+ must be raised .
1769
1771
1770
- Note : When a field error is raised on a non -null value , the error propagates to
1771
- the parent field . For more information on this process , see "Errors and
1772
- Non-Nullability" within the Execution section .
1772
+ Note : When a _field error_ is raised on a non -null value , the error propagates
1773
+ to the parent field . For more information on this process , see
1774
+ [Errors and Non -Null Fields ](#sec-Executing-Selection-Sets.Errors-and-Non-Null-Fields)
1775
+ within the Execution section.
1773
1776
1774
1777
**Input Coercion**
1775
1778
1776
1779
If an argument or input-object field of a Non-Null type is not provided, is
1777
1780
provided with the literal value {null}, or is provided with a variable that was
1778
1781
either not provided a value at runtime, or was provided the value {null}, then a
1779
- request error must be raised .
1782
+ _request error_ must be raised.
1780
1783
1781
1784
If the value provided to the Non-Null type is provided with a literal value
1782
1785
other than {null}, or a Non-Null variable value, it is coerced using the input
0 commit comments