@@ -329,8 +329,8 @@ A GraphQL schema may describe that a field represents a list of another type;
329
329
the `List` type is provided for this reason, and wraps another type.
330
330
331
331
Similarly, the `Non-Null` type wraps another type, and denotes that the
332
- resulting value will never be {null} (and that a _field error_ cannot result in
333
- a {null} value).
332
+ resulting value will never be {null} (and that an _execution error_ cannot
333
+ result in a {null} value).
334
334
335
335
These two types are referred to as "wrapping types" ; non -wrapping types are
336
336
referred to as "named types" . A wrapping type has an underlying named type ,
@@ -351,7 +351,7 @@ IsInputType(type):
351
351
352
352
- If {type } is a List type or Non -Null type :
353
353
- Let {unwrappedType } be the unwrapped type of {type}.
354
- - Return IsInputType ({ unwrappedType}) .
354
+ - Return { IsInputType (unwrappedType)} .
355
355
- If {type } is a Scalar , Enum , or Input Object type :
356
356
- Return {true }.
357
357
- Return {false }.
@@ -360,7 +360,7 @@ IsOutputType(type):
360
360
361
361
- If {type } is a List type or Non -Null type :
362
362
- Let {unwrappedType } be the unwrapped type of {type}.
363
- - Return IsOutputType ({ unwrappedType}) .
363
+ - Return { IsOutputType (unwrappedType)} .
364
364
- If {type } is a Scalar , Object , Interface , Union , or Enum type :
365
365
- Return {true }.
366
366
- Return {false }.
@@ -461,14 +461,14 @@ more guidance.
461
461
462
462
A GraphQL service, when preparing a field of a given scalar type, must uphold
463
463
the contract the scalar type describes, either by coercing the value or
464
- producing a _field error_ if a value cannot be coerced or if coercion may result
465
- in data loss.
464
+ producing an _execution error_ if a value cannot be coerced or if coercion may
465
+ result in data loss.
466
466
467
467
A GraphQL service may decide to allow coercing different internal types to the
468
468
expected return type. For example when coercing a field of type {Int} a boolean
469
469
{true } value may produce {1} or a string value {"123" } may be parsed as base -10
470
470
{123}. However if internal type coercion cannot be reasonably performed without
471
- losing information , then it must raise a _field error_ .
471
+ losing information , then it must raise an _execution error_ .
472
472
473
473
Since this coercion behavior is not observable to clients of the GraphQL
474
474
service , the precise rules of coercion are left to the implementation . The only
@@ -513,15 +513,15 @@ Fields returning the type {Int} expect to encounter 32-bit integer internal
513
513
values .
514
514
515
515
GraphQL services may coerce non -integer internal values to integers when
516
- reasonable without losing information , otherwise they must raise a _field
516
+ reasonable without losing information , otherwise they must raise an _execution
517
517
error_ . Examples of this may include returning `1` for the floating -point number
518
518
`1.0`, or returning `123` for the string `"123" `. In scenarios where coercion
519
- may lose data , raising a field error is more appropriate . For example , a
520
- floating -point number `1.2` should raise a field error instead of being
519
+ may lose data , raising an execution error is more appropriate . For example , a
520
+ floating -point number `1.2` should raise an execution error instead of being
521
521
truncated to `1`.
522
522
523
523
If the integer internal value represents a value less than -2<sup >31</sup > or
524
- greater than or equal to 2<sup >31</sup >, a _field error_ should be raised .
524
+ greater than or equal to 2<sup >31</sup >, an _execution error_ should be raised .
525
525
526
526
**Input Coercion **
527
527
@@ -548,12 +548,12 @@ Fields returning the type {Float} expect to encounter double-precision
548
548
floating -point internal values .
549
549
550
550
GraphQL services may coerce non -floating -point internal values to {Float } when
551
- reasonable without losing information , otherwise they must raise a _field
551
+ reasonable without losing information , otherwise they must raise an _execution
552
552
error_ . Examples of this may include returning `1.0` for the integer number `1`,
553
553
or `123.0` for the string `"123" `.
554
554
555
555
Non -finite floating -point internal values ({NaN} and {Infinity}) cannot be
556
- coerced to {Float } and must raise a _field error_ .
556
+ coerced to {Float } and must raise an _execution error_ .
557
557
558
558
**Input Coercion **
559
559
@@ -579,9 +579,9 @@ that representation must be used to serialize this type.
579
579
Fields returning the type {String} expect to encounter Unicode string values .
580
580
581
581
GraphQL services may coerce non -string raw values to {String } when reasonable
582
- without losing information , otherwise they must raise a _field error_ . Examples
583
- of this may include returning the string `"true" ` for a boolean true value , or
584
- the string `"1" ` for the integer `1`.
582
+ without losing information , otherwise they must raise an _execution error_ .
583
+ Examples of this may include returning the string `"true" ` for a boolean true
584
+ value , or the string `"1" ` for the integer `1`.
585
585
586
586
**Input Coercion **
587
587
@@ -600,8 +600,8 @@ representation of the integers `1` and `0`.
600
600
Fields returning the type {Boolean} expect to encounter boolean internal values .
601
601
602
602
GraphQL services may coerce non -boolean raw values to {Boolean } when reasonable
603
- without losing information , otherwise they must raise a _field error_ . Examples
604
- of this may include returning `true ` for non -zero numbers .
603
+ without losing information , otherwise they must raise an _execution error_ .
604
+ Examples of this may include returning `true ` for non -zero numbers .
605
605
606
606
**Input Coercion **
607
607
@@ -623,7 +623,7 @@ large 128-bit random numbers, to base64 encoded values, or string values of a
623
623
format like [GUID ](https ://en .wikipedia .org /wiki /Globally_unique_identifier ).
624
624
625
625
GraphQL services should coerce as appropriate given the ID formats they expect .
626
- When coercion is not possible they must raise a _field error_ .
626
+ When coercion is not possible they must raise an _execution error_ .
627
627
628
628
**Input Coercion **
629
629
@@ -947,6 +947,7 @@ IsValidImplementation(type, implementedType):
947
947
2. Let {implementedFieldType } be the return type of {implementedField }.
948
948
3. {IsValidImplementationFieldType (fieldType, implementedFieldType)} must
949
949
be {true }.
950
+ 6. If {field } is deprecated then {implementedField } must also be deprecated .
950
951
951
952
IsValidImplementationFieldType (fieldType, implementedFieldType):
952
953
@@ -1492,7 +1493,7 @@ enum Direction {
1492
1493
**Result Coercion **
1493
1494
1494
1495
GraphQL services must return one of the defined set of possible values . If a
1495
- reasonable coercion is not possible they must raise a _field error_ .
1496
+ reasonable coercion is not possible they must raise an _execution error_ .
1496
1497
1497
1498
**Input Coercion **
1498
1499
@@ -1548,8 +1549,9 @@ Fields may accept arguments to configure their behavior. These inputs are often
1548
1549
scalars or enums , but they sometimes need to represent more complex values .
1549
1550
1550
1551
A GraphQL Input Object defines a set of input fields ; the input fields are
1551
- either scalars , enums , or other input objects . This allows arguments to accept
1552
- arbitrarily complex structs .
1552
+ scalars , enums , other input objects , or any wrapping type whose underlying base
1553
+ type is one of those three . This allows arguments to accept arbitrarily complex
1554
+ structs .
1553
1555
1554
1556
In this example , an Input Object called `Point2D ` describes `x ` and `y ` inputs :
1555
1557
@@ -1676,10 +1678,10 @@ is constructed with the following rules:
1676
1678
1677
1679
- If a variable is provided for an input object field , the runtime value of that
1678
1680
variable must be used . If the runtime value is {null } and the field type is
1679
- non -null , a _field error_ must be raised . If no runtime value is provided , the
1680
- variable definition 's default value should be used . If the variable definition
1681
- does not provide a default value , the input object field definition ' s default
1682
- value should be used .
1681
+ non -null , an _execution error_ must be raised . If no runtime value is
1682
+ provided , the variable definition 's default value should be used . If the
1683
+ variable definition does not provide a default value , the input object field
1684
+ definition ' s default value should be used .
1683
1685
1684
1686
Further , if the input object is a OneOf Input Object , the following additional
1685
1687
rules apply :
@@ -1828,19 +1830,19 @@ brackets like this: `pets: [Pet]`. Nesting lists is allowed: `matrix: [[Int]]`.
1828
1830
1829
1831
GraphQL services must return an ordered list as the result of a list type . Each
1830
1832
item in the list must be the result of a result coercion of the item type . If a
1831
- reasonable coercion is not possible it must raise a _field error_ . In
1833
+ reasonable coercion is not possible it must raise an _execution error_ . In
1832
1834
particular , if a non -list is returned , the coercion should fail , as this
1833
1835
indicates a mismatch in expectations between the type system and the
1834
1836
implementation .
1835
1837
1836
1838
If a list 's item type is nullable , then errors occurring during preparation or
1837
1839
coercion of an individual item in the list must result in a the value {null } at
1838
- that position in the list along with a _field error_ added to the response . If a
1839
- list 's item type is non -null , a field error occurring at an individual item in
1840
- the list must result in a field error for the entire list .
1840
+ that position in the list along with an _execution error_ added to the response .
1841
+ If a list 's item type is non -null , an execution error occurring at an individual
1842
+ item in the list must result in an execution error for the entire list .
1841
1843
1842
- Note : See [Handling Field Errors ](#sec-Handling-Field -Errors) for more about
1843
- this behavior.
1844
+ Note : See [Handling Execution Errors ](#sec-Handling-Execution -Errors) for more
1845
+ about this behavior.
1844
1846
1845
1847
**Input Coercion**
1846
1848
@@ -1898,12 +1900,13 @@ always optional and non-null types are always required.
1898
1900
In all of the above result coercions , {null } was considered a valid value . To
1899
1901
coerce the result of a Non -Null type , the coercion of the wrapped type should be
1900
1902
performed . If that result was not {null }, then the result of coercing the
1901
- Non -Null type is that result . If that result was {null }, then a _field error_
1902
- must be raised .
1903
+ Non -Null type is that result . If that result was {null }, then an _execution
1904
+ error_ must be raised .
1903
1905
1904
- Note : When a _field error_ is raised on a non -null value , the error propagates
1905
- to the parent field . For more information on this process , see
1906
- [Errors and Non -Null Fields ](#sec-Executing-Selection-Sets.Errors-and-Non-Null-Fields)
1906
+ Note : When an _execution error_ is raised on a non -null _response position_ , the
1907
+ error propagates to the parent _response position_ . For more information on this
1908
+ process , see
1909
+ [Errors and Non -Null Types ](#sec-Executing-Selection-Sets.Errors-and-Non-Null-Types)
1907
1910
within the Execution section.
1908
1911
1909
1912
**Input Coercion**
@@ -2124,19 +2127,20 @@ directive @invalidExample(arg: String @invalidExample) on ARGUMENT_DEFINITION
2124
2127
Note : The order in which directives appear may be significant , including
2125
2128
repeatable directives .
2126
2129
2127
- **Validation **
2130
+ **Type Validation **
2128
2131
2129
- 1. A directive definition must not contain the use of a directive which
2132
+ 1. A Directive definition must include at least one DirectiveLocation .
2133
+ 2. A Directive definition must not contain the use of a Directive which
2130
2134
references itself directly .
2131
- 2 . A directive definition must not contain the use of a directive which
2135
+ 3 . A Directive definition must not contain the use of a Directive which
2132
2136
references itself indirectly by referencing a Type or Directive which
2133
- transitively includes a reference to this directive .
2134
- 3 . The directive must not have a name which begins with the characters {"\_\_" }
2137
+ transitively includes a reference to this Directive .
2138
+ 4 . The Directive must not have a name which begins with the characters {"\_\_" }
2135
2139
(two underscores).
2136
- 4 . For each argument of the directive :
2140
+ 5 . For each argument of the Directive :
2137
2141
1. The argument must not have a name which begins with the characters
2138
2142
{"\_\_" } (two underscores).
2139
- 2. The argument must have a unique name within that directive ; no two
2143
+ 2. The argument must have a unique name within that Directive ; no two
2140
2144
arguments may share the same name .
2141
2145
3. The argument must accept a type where {IsInputType (argumentType)} returns
2142
2146
{true }.
0 commit comments