@@ -329,8 +329,8 @@ A GraphQL schema may describe that a field represents a list of another type;
329329the `List` type is provided for this reason, and wraps another type.
330330
331331Similarly, 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).
334334
335335These two types are referred to as "wrapping types" ; non -wrapping types are
336336referred to as "named types" . A wrapping type has an underlying named type ,
@@ -351,7 +351,7 @@ IsInputType(type):
351351
352352- If {type } is a List type or Non -Null type :
353353 - Let {unwrappedType } be the unwrapped type of {type}.
354- - Return IsInputType ({ unwrappedType}) .
354+ - Return { IsInputType (unwrappedType)} .
355355- If {type } is a Scalar , Enum , or Input Object type :
356356 - Return {true }.
357357- Return {false }.
@@ -360,7 +360,7 @@ IsOutputType(type):
360360
361361- If {type } is a List type or Non -Null type :
362362 - Let {unwrappedType } be the unwrapped type of {type}.
363- - Return IsOutputType ({ unwrappedType}) .
363+ - Return { IsOutputType (unwrappedType)} .
364364- If {type } is a Scalar , Object , Interface , Union , or Enum type :
365365 - Return {true }.
366366- Return {false }.
@@ -461,14 +461,14 @@ more guidance.
461461
462462A GraphQL service, when preparing a field of a given scalar type, must uphold
463463the 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.
466466
467467A GraphQL service may decide to allow coercing different internal types to the
468468expected return type. For example when coercing a field of type {Int} a boolean
469469{true } value may produce {1} or a string value {"123" } may be parsed as base -10
470470{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_ .
472472
473473Since this coercion behavior is not observable to clients of the GraphQL
474474service , 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
513513values .
514514
515515GraphQL 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
517517error_ . Examples of this may include returning `1` for the floating -point number
518518`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
521521truncated to `1`.
522522
523523If 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 .
525525
526526**Input Coercion **
527527
@@ -548,12 +548,12 @@ Fields returning the type {Float} expect to encounter double-precision
548548floating -point internal values .
549549
550550GraphQL 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
552552error_ . Examples of this may include returning `1.0` for the integer number `1`,
553553or `123.0` for the string `"123" `.
554554
555555Non -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_ .
557557
558558**Input Coercion **
559559
@@ -579,9 +579,9 @@ that representation must be used to serialize this type.
579579Fields returning the type {String} expect to encounter Unicode string values .
580580
581581GraphQL 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`.
585585
586586**Input Coercion **
587587
@@ -600,8 +600,8 @@ representation of the integers `1` and `0`.
600600Fields returning the type {Boolean} expect to encounter boolean internal values .
601601
602602GraphQL 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 .
605605
606606**Input Coercion **
607607
@@ -623,7 +623,7 @@ large 128-bit random numbers, to base64 encoded values, or string values of a
623623format like [GUID ](https ://en .wikipedia .org /wiki /Globally_unique_identifier ).
624624
625625GraphQL 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_ .
627627
628628**Input Coercion **
629629
@@ -949,6 +949,7 @@ IsValidImplementation(type, implementedType):
949949 2. Let {implementedFieldType } be the return type of {implementedField }.
950950 3. {IsValidImplementationFieldType (fieldType, implementedFieldType)} must
951951 be {true }.
952+ 6. If {field } is deprecated then {implementedField } must also be deprecated .
952953
953954IsValidImplementationFieldType (fieldType, implementedFieldType):
954955
@@ -1494,7 +1495,7 @@ enum Direction {
14941495**Result Coercion **
14951496
14961497GraphQL services must return one of the defined set of possible values . If a
1497- reasonable coercion is not possible they must raise a _field error_ .
1498+ reasonable coercion is not possible they must raise an _execution error_ .
14981499
14991500**Input Coercion **
15001501
@@ -1550,8 +1551,9 @@ Fields may accept arguments to configure their behavior. These inputs are often
15501551scalars or enums , but they sometimes need to represent more complex values .
15511552
15521553A GraphQL Input Object defines a set of input fields ; the input fields are
1553- either scalars , enums , or other input objects . This allows arguments to accept
1554- arbitrarily complex structs .
1554+ scalars , enums , other input objects , or any wrapping type whose underlying base
1555+ type is one of those three . This allows arguments to accept arbitrarily complex
1556+ structs .
15551557
15561558In this example , an Input Object called `Point2D ` describes `x ` and `y ` inputs :
15571559
@@ -1657,10 +1659,10 @@ is constructed with the following rules:
16571659
16581660- If a variable is provided for an input object field , the runtime value of that
16591661 variable must be used . If the runtime value is {null } and the field type is
1660- non -null , a _field error_ must be raised . If no runtime value is provided , the
1661- variable definition 's default value should be used . If the variable definition
1662- does not provide a default value , the input object field definition ' s default
1663- value should be used .
1662+ non -null , an _execution error_ must be raised . If no runtime value is
1663+ provided , the variable definition 's default value should be used . If the
1664+ variable definition does not provide a default value , the input object field
1665+ definition ' s default value should be used .
16641666
16651667Following are examples of input coercion for an input object type with a
16661668`String ` field `a ` and a required (non-null) `Int !` field `b `:
@@ -1783,19 +1785,19 @@ brackets like this: `pets: [Pet]`. Nesting lists is allowed: `matrix: [[Int]]`.
17831785
17841786GraphQL services must return an ordered list as the result of a list type . Each
17851787item in the list must be the result of a result coercion of the item type . If a
1786- reasonable coercion is not possible it must raise a _field error_ . In
1788+ reasonable coercion is not possible it must raise an _execution error_ . In
17871789particular , if a non -list is returned , the coercion should fail , as this
17881790indicates a mismatch in expectations between the type system and the
17891791implementation .
17901792
17911793If a list 's item type is nullable , then errors occurring during preparation or
17921794coercion of an individual item in the list must result in a the value {null } at
1793- that position in the list along with a _field error_ added to the response . If a
1794- list 's item type is non -null , a field error occurring at an individual item in
1795- the list must result in a field error for the entire list .
1795+ that position in the list along with an _execution error_ added to the response .
1796+ If a list 's item type is non -null , an execution error occurring at an individual
1797+ item in the list must result in an execution error for the entire list .
17961798
1797- Note : See [Handling Field Errors ](#sec-Handling-Field -Errors) for more about
1798- this behavior.
1799+ Note : See [Handling Execution Errors ](#sec-Handling-Execution -Errors) for more
1800+ about this behavior.
17991801
18001802**Input Coercion**
18011803
@@ -1853,12 +1855,13 @@ always optional and non-null types are always required.
18531855In all of the above result coercions , {null } was considered a valid value . To
18541856coerce the result of a Non -Null type , the coercion of the wrapped type should be
18551857performed . If that result was not {null }, then the result of coercing the
1856- Non -Null type is that result . If that result was {null }, then a _field error_
1857- must be raised .
1858+ Non -Null type is that result . If that result was {null }, then an _execution
1859+ error_ must be raised .
18581860
1859- Note : When a _field error_ is raised on a non -null value , the error propagates
1860- to the parent field . For more information on this process , see
1861- [Errors and Non -Null Fields ](#sec-Executing-Selection-Sets.Errors-and-Non-Null-Fields)
1861+ Note : When an _execution error_ is raised on a non -null _response position_ , the
1862+ error propagates to the parent _response position_ . For more information on this
1863+ process , see
1864+ [Errors and Non -Null Types ](#sec-Executing-Selection-Sets.Errors-and-Non-Null-Types)
18621865within the Execution section.
18631866
18641867**Input Coercion**
@@ -2076,19 +2079,20 @@ directive @invalidExample(arg: String @invalidExample) on ARGUMENT_DEFINITION
20762079Note : The order in which directives appear may be significant , including
20772080repeatable directives .
20782081
2079- **Validation **
2082+ **Type Validation **
20802083
2081- 1. A directive definition must not contain the use of a directive which
2084+ 1. A Directive definition must include at least one DirectiveLocation .
2085+ 2. A Directive definition must not contain the use of a Directive which
20822086 references itself directly .
2083- 2 . A directive definition must not contain the use of a directive which
2087+ 3 . A Directive definition must not contain the use of a Directive which
20842088 references itself indirectly by referencing a Type or Directive which
2085- transitively includes a reference to this directive .
2086- 3 . The directive must not have a name which begins with the characters {"\_\_" }
2089+ transitively includes a reference to this Directive .
2090+ 4 . The Directive must not have a name which begins with the characters {"\_\_" }
20872091 (two underscores).
2088- 4 . For each argument of the directive :
2092+ 5 . For each argument of the Directive :
20892093 1. The argument must not have a name which begins with the characters
20902094 {"\_\_" } (two underscores).
2091- 2. The argument must have a unique name within that directive ; no two
2095+ 2. The argument must have a unique name within that Directive ; no two
20922096 arguments may share the same name .
20932097 3. The argument must accept a type where {IsInputType (argumentType)} returns
20942098 {true }.
0 commit comments