Skip to content

Commit fdc2b81

Browse files
committed
Rename 'runtime error' to 'execution error'
1 parent c5eed34 commit fdc2b81

File tree

4 files changed

+64
-64
lines changed

4 files changed

+64
-64
lines changed

spec/Section 3 -- Type System.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ A GraphQL schema may describe that a field represents a list of another type;
329329
the `List` type is provided for this reason, and wraps another type.
330330

331331
Similarly, the `Non-Null` type wraps another type, and denotes that the
332-
resulting value will never be {null} (and that a _runtime error_ cannot result
333-
in a {null} value).
332+
resulting value will never be {null} (and that an _execution error_ cannot
333+
result in a {null} value).
334334

335335
These two types are referred to as "wrapping types"; non-wrapping types are
336336
referred to as "named types". A wrapping type has an underlying named type,
@@ -461,14 +461,14 @@ more guidance.
461461

462462
A GraphQL service, when preparing a field of a given scalar type, must uphold
463463
the contract the scalar type describes, either by coercing the value or
464-
producing a _runtime error_ if a value cannot be coerced or if coercion may
464+
producing an _execution error_ if a value cannot be coerced or if coercion may
465465
result in data loss.
466466

467467
A GraphQL service may decide to allow coercing different internal types to the
468468
expected 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 _runtime error_.
471+
losing information, then it must raise an _execution error_.
472472

473473
Since this coercion behavior is not observable to clients of the GraphQL
474474
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
513513
values.
514514

515515
GraphQL services may coerce non-integer internal values to integers when
516-
reasonable without losing information, otherwise they must raise a _runtime
516+
reasonable without losing information, otherwise they must raise an _execution
517517
error_. 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 runtime error is more appropriate. For example, a
520-
floating-point number `1.2` should raise a runtime 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
521521
truncated to `1`.
522522

523523
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 _runtime 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
548548
floating-point internal values.
549549

550550
GraphQL services may coerce non-floating-point internal values to {Float} when
551-
reasonable without losing information, otherwise they must raise a _runtime
551+
reasonable without losing information, otherwise they must raise an _execution
552552
error_. Examples of this may include returning `1.0` for the integer number `1`,
553553
or `123.0` for the string `"123"`.
554554

555555
Non-finite floating-point internal values ({NaN} and {Infinity}) cannot be
556-
coerced to {Float} and must raise a _runtime error_.
556+
coerced to {Float} and must raise an _execution error_.
557557

558558
**Input Coercion**
559559

@@ -579,7 +579,7 @@ that representation must be used to serialize this type.
579579
Fields returning the type {String} expect to encounter Unicode string values.
580580

581581
GraphQL services may coerce non-string raw values to {String} when reasonable
582-
without losing information, otherwise they must raise a _runtime error_.
582+
without losing information, otherwise they must raise an _execution error_.
583583
Examples of this may include returning the string `"true"` for a boolean true
584584
value, or the string `"1"` for the integer `1`.
585585

@@ -600,7 +600,7 @@ representation of the integers `1` and `0`.
600600
Fields returning the type {Boolean} expect to encounter boolean internal values.
601601

602602
GraphQL services may coerce non-boolean raw values to {Boolean} when reasonable
603-
without losing information, otherwise they must raise a _runtime error_.
603+
without losing information, otherwise they must raise an _execution error_.
604604
Examples of this may include returning `true` for non-zero numbers.
605605

606606
**Input Coercion**
@@ -623,7 +623,7 @@ large 128-bit random numbers, to base64 encoded values, or string values of a
623623
format like [GUID](https://en.wikipedia.org/wiki/Globally_unique_identifier).
624624

625625
GraphQL services should coerce as appropriate given the ID formats they expect.
626-
When coercion is not possible they must raise a _runtime error_.
626+
When coercion is not possible they must raise an _execution error_.
627627

628628
**Input Coercion**
629629

@@ -1492,7 +1492,7 @@ enum Direction {
14921492
**Result Coercion**
14931493

14941494
GraphQL services must return one of the defined set of possible values. If a
1495-
reasonable coercion is not possible they must raise a _runtime error_.
1495+
reasonable coercion is not possible they must raise an _execution error_.
14961496

14971497
**Input Coercion**
14981498

@@ -1654,9 +1654,9 @@ is constructed with the following rules:
16541654

16551655
- If a variable is provided for an input object field, the runtime value of that
16561656
variable must be used. If the runtime value is {null} and the field type is
1657-
non-null, a _runtime error_ must be raised. If no runtime value is provided,
1658-
the variable definition's default value should be used. If the variable
1659-
definition does not provide a default value, the input object field
1657+
non-null, an _execution error_ must be raised. If no runtime value is
1658+
provided, the variable definition's default value should be used. If the
1659+
variable definition does not provide a default value, the input object field
16601660
definition's default value should be used.
16611661

16621662
Following are examples of input coercion for an input object type with a
@@ -1742,16 +1742,16 @@ brackets like this: `pets: [Pet]`. Nesting lists is allowed: `matrix: [[Int]]`.
17421742

17431743
GraphQL services must return an ordered list as the result of a list type. Each
17441744
item in the list must be the result of a result coercion of the item type. If a
1745-
reasonable coercion is not possible it must raise a _runtime error_. In
1745+
reasonable coercion is not possible it must raise an _execution error_. In
17461746
particular, if a non-list is returned, the coercion should fail, as this
17471747
indicates a mismatch in expectations between the type system and the
17481748
implementation.
17491749

17501750
If a list's item type is nullable, then errors occurring during preparation or
17511751
coercion of an individual item in the list must result in a the value {null} at
1752-
that position in the list along with a _runtime error_ added to the response. If
1753-
a list's item type is non-null, a runtime error occurring at an individual item
1754-
in the list must result in a runtime error for the entire list.
1752+
that position in the list along with an _execution error_ added to the response.
1753+
If a list's item type is non-null, an execution error occurring at an individual
1754+
item in the list must result in an execution error for the entire list.
17551755

17561756
Note: See [Handling Runtime Errors](#sec-Handling-Runtime-Errors) for more about
17571757
this behavior.
@@ -1812,10 +1812,10 @@ always optional and non-null types are always required.
18121812
In all of the above result coercions, {null} was considered a valid value. To
18131813
coerce the result of a Non-Null type, the coercion of the wrapped type should be
18141814
performed. If that result was not {null}, then the result of coercing the
1815-
Non-Null type is that result. If that result was {null}, then a _runtime error_
1816-
must be raised.
1815+
Non-Null type is that result. If that result was {null}, then an _execution
1816+
error_ must be raised.
18171817

1818-
Note: When a _runtime error_ is raised on a non-null _response position_, the
1818+
Note: When an _execution error_ is raised on a non-null _response position_, the
18191819
error propagates to the parent _response position_. For more information on this
18201820
process, see
18211821
[Errors and Non-Null Types](#sec-Executing-Selection-Sets.Errors-and-Non-Null-Types)

spec/Section 5 -- Validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2010,4 +2010,4 @@ query booleanArgQueryWithDefault($booleanArg: Boolean = true) {
20102010
```
20112011

20122012
Note: The value {null} could still be provided to such a variable at runtime. A
2013-
non-null argument must raise a _runtime error_ if provided a {null} value.
2013+
non-null argument must raise an _execution error_ if provided a {null} value.

spec/Section 6 -- Execution.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ ExecuteQuery(query, schema, variableValues, initialValue):
137137
- Let {data} be the result of running {ExecuteSelectionSet(selectionSet,
138138
queryType, initialValue, variableValues)} _normally_ (allowing
139139
parallelization).
140-
- Let {errors} be the list of all _runtime error_ raised while executing the
140+
- Let {errors} be the list of all _execution error_ raised while executing the
141141
selection set.
142142
- Return an unordered map containing {data} and {errors}.
143143

@@ -158,7 +158,7 @@ ExecuteMutation(mutation, schema, variableValues, initialValue):
158158
- Let {selectionSet} be the top level selection set in {mutation}.
159159
- Let {data} be the result of running {ExecuteSelectionSet(selectionSet,
160160
mutationType, initialValue, variableValues)} _serially_.
161-
- Let {errors} be the list of all _runtime error_ raised while executing the
161+
- Let {errors} be the list of all _execution error_ raised while executing the
162162
selection set.
163163
- Return an unordered map containing {data} and {errors}.
164164

@@ -317,7 +317,7 @@ MapSourceToResponseEvent(sourceStream, subscription, schema, variableValues):
317317
- Complete {responseStream} normally.
318318
- Return {responseStream}.
319319

320-
Note: Since {ExecuteSubscriptionEvent()} handles all _runtime error_, and
320+
Note: Since {ExecuteSubscriptionEvent()} handles all _execution error_, and
321321
_request error_ only occur during {CreateSourceEventStream()}, the only
322322
remaining error condition handled from {ExecuteSubscriptionEvent()} are internal
323323
exceptional errors not described by this specification.
@@ -330,7 +330,7 @@ ExecuteSubscriptionEvent(subscription, schema, variableValues, initialValue):
330330
- Let {data} be the result of running {ExecuteSelectionSet(selectionSet,
331331
subscriptionType, initialValue, variableValues)} _normally_ (allowing
332332
parallelization).
333-
- Let {errors} be the list of all _runtime error_ raised while executing the
333+
- Let {errors} be the list of all _execution error_ raised while executing the
334334
selection set.
335335
- Return an unordered map containing {data} and {errors}.
336336

@@ -384,10 +384,10 @@ is explained in greater detail in the Field Collection section below.
384384
**Errors and Non-Null Types**
385385

386386
If during {ExecuteSelectionSet()} a _response position_ with a non-null type
387-
raises a _runtime error_ then that error must propagate to the parent response
388-
position (the entire selection set in the case of a field, or the entire list in
389-
the case of a list position), either resolving to {null} if allowed or being
390-
further propagated to a parent response position.
387+
raises an _execution error_ then that error must propagate to the parent
388+
response position (the entire selection set in the case of a field, or the
389+
entire list in the case of a list position), either resolving to {null} if
390+
allowed or being further propagated to a parent response position.
391391

392392
If this occurs, any sibling response positions which have not yet executed or
393393
have not yet yielded a value may be cancelled to avoid unnecessary work.
@@ -628,7 +628,7 @@ At each argument position in an operation may be a literal {Value}, or a
628628
{Variable} to be provided at runtime.
629629

630630
Any _request error_ raised during {CoerceArgumentValues()} should be treated
631-
instead as a _runtime error_.
631+
instead as an _execution error_.
632632

633633
CoerceArgumentValues(objectType, field, variableValues):
634634

@@ -656,7 +656,7 @@ CoerceArgumentValues(objectType, field, variableValues):
656656
- Add an entry to {coercedValues} named {argumentName} with the value
657657
{defaultValue}.
658658
- Otherwise if {argumentType} is a Non-Nullable type, and either {hasValue} is
659-
not {true} or {value} is {null}, raise a _runtime error_.
659+
not {true} or {value} is {null}, raise an _execution error_.
660660
- Otherwise if {hasValue} is {true}:
661661
- If {value} is {null}:
662662
- Add an entry to {coercedValues} named {argumentName} with the value
@@ -666,7 +666,7 @@ CoerceArgumentValues(objectType, field, variableValues):
666666
{value}.
667667
- Otherwise:
668668
- If {value} cannot be coerced according to the input coercion rules of
669-
{argumentType}, raise a _runtime error_.
669+
{argumentType}, raise an _execution error_.
670670
- Let {coercedValue} be the result of coercing {value} according to the
671671
input coercion rules of {argumentType}.
672672
- Add an entry to {coercedValues} named {argumentName} with the value
@@ -713,12 +713,12 @@ CompleteValue(fieldType, fields, result, variableValues):
713713
- Let {innerType} be the inner type of {fieldType}.
714714
- Let {completedResult} be the result of calling {CompleteValue(innerType,
715715
fields, result, variableValues)}.
716-
- If {completedResult} is {null}, raise a _runtime error_.
716+
- If {completedResult} is {null}, raise an _execution error_.
717717
- Return {completedResult}.
718718
- If {result} is {null} (or another internal value similar to {null} such as
719719
{undefined}), return {null}.
720720
- If {fieldType} is a List type:
721-
- If {result} is not a collection of values, raise a _runtime error_.
721+
- If {result} is not a collection of values, raise an _execution error_.
722722
- Let {innerType} be the inner type of {fieldType}.
723723
- Return a list where each list item is the result of calling
724724
{CompleteValue(innerType, fields, resultItem, variableValues)}, where
@@ -753,7 +753,7 @@ CoerceResult(leafType, value):
753753
- Return the result of calling the internal method provided by the type system
754754
for determining the "result coercion" of {leafType} given the value {value}.
755755
This internal method must return a valid value for the type and not {null}.
756-
Otherwise raise a _runtime error_.
756+
Otherwise raise an _execution error_.
757757

758758
Note: If a field resolver returns {null} then it is handled within
759759
{CompleteValue()} before {CoerceResult()} is called. Therefore both the input
@@ -814,39 +814,39 @@ MergeSelectionSets(fields):
814814

815815
### Handling Runtime Errors
816816

817-
A _runtime error_ is an error raised from a particular field during value
817+
An _execution error_ is an error raised from a particular field during value
818818
resolution or coercion. While these errors should be reported in the response,
819819
they are "handled" by producing a partial response.
820820

821821
Note: This is distinct from a _request error_ which results in a response with
822822
no data.
823823

824-
If a runtime error is raised while resolving a field (either directly or nested
825-
inside any lists), it is handled as though the position at which the error
826-
occurred resulted in {null}, and the error must be added to the {"errors"} list
827-
in the response.
824+
If an execution error is raised while resolving a field (either directly or
825+
nested inside any lists), it is handled as though the position at which the
826+
error occurred resulted in {null}, and the error must be added to the {"errors"}
827+
list in the response.
828828

829829
If the result of resolving a _response position_ is {null} (either due to the
830-
result of {ResolveFieldValue()} or because a runtime error was raised), and that
831-
position is of a `Non-Null` type, then a runtime error is raised at that
830+
result of {ResolveFieldValue()} or because an execution error was raised), and
831+
that position is of a `Non-Null` type, then an execution error is raised at that
832832
position. The error must be added to the {"errors"} list in the response.
833833

834-
If a _response position_ returns {null} because of a runtime error which has
834+
If a _response position_ returns {null} because of an execution error which has
835835
already been added to the {"errors"} list in the response, the {"errors"} list
836836
must not be further affected. That is, only one error should be added to the
837837
errors list per _response position_.
838838

839-
Since `Non-Null` response positions cannot be {null}, runtime errors are
839+
Since `Non-Null` response positions cannot be {null}, execution errors are
840840
propagated to be handled by the parent _response position_. If the parent
841841
response position may be {null} then it resolves to {null}, otherwise if it is a
842-
`Non-Null` type, the runtime error is further propagated to its parent _response
843-
position_.
842+
`Non-Null` type, the execution error is further propagated to its parent
843+
_response position_.
844844

845845
If a `List` type wraps a `Non-Null` type, and one of the elements of that list
846846
resolves to {null}, then the entire list must resolve to {null}. If the `List`
847-
type is also wrapped in a `Non-Null`, the runtime error continues to propagate
847+
type is also wrapped in a `Non-Null`, the execution error continues to propagate
848848
upwards.
849849

850850
If all response positions from the root of the request to the source of the
851-
runtime error return `Non-Null` types, then the {"data"} entry in the response
851+
execution error return `Non-Null` types, then the {"data"} entry in the response
852852
should be {null}.

spec/Section 7 -- Response.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ response. The service's response describes the result of executing the requested
55
operation if successful, and describes any errors raised during the request.
66

77
A response may contain both a partial response as well as a list of errors in
8-
the case that any _runtime error_ was raised and replaced with {null}.
8+
the case that any _execution error_ was raised and replaced with {null}.
99

1010
## Response Format
1111

@@ -72,8 +72,8 @@ present. It must contain at least one _request error_ indicating why no data was
7272
able to be returned.
7373

7474
If the `data` entry in the response is present (including if it is the value
75-
{null}), the `errors` entry must be present if and only if one or more _runtime
76-
error_ was raised during execution.
75+
{null}), the `errors` entry must be present if and only if one or more
76+
_execution error_ was raised during execution.
7777

7878
**Request Errors**
7979

@@ -92,29 +92,29 @@ be halted.
9292
<!-- This link exists for legacy hyperlink support -->
9393
</a>
9494

95-
**Runtime Errors**
95+
**Execution Errors**
9696

97-
:: A _runtime error_ is an error raised during the execution of a particular
97+
:: An _execution error_ is an error raised during the execution of a particular
9898
field which results in partial response data. This may occur due to failure to
9999
coerce the arguments for the field, an internal error during value resolution,
100-
or failure to coerce the resulting value. A _runtime error_ may occur in any
100+
or failure to coerce the resulting value. An _execution error_ may occur in any
101101
_response position_.
102102

103-
Note: In previous versions of this specification _runtime error_ was called
103+
Note: In previous versions of this specification _execution error_ was called
104104
_field error_.
105105

106106
:: A _response position_ is an identifiable position in the response: either a
107107
_field_, or a (potentially nested) list position within a field if the field has
108-
a `List` type. A _runtime error_ may only occur within a _response position_.
108+
a `List` type. An _execution error_ may only occur within a _response position_.
109109
The _response position_ is indicated in the _response_ via the error's _path
110110
entry_.
111111

112-
A runtime error is typically the fault of a GraphQL service.
112+
An execution error is typically the fault of a GraphQL service.
113113

114-
If a runtime error is raised, execution attempts to continue and a partial
114+
If an execution error is raised, execution attempts to continue and a partial
115115
result is produced (see
116-
[Handling Runtime Errors](#sec-Handling-Runtime-Errors)). The `data` entry in
117-
the response must be present. The `errors` entry must include this error.
116+
[Handling Execution Errors](#sec-Handling-Execution-Errors)). The `data` entry
117+
in the response must be present. The `errors` entry must include this error.
118118

119119
**Error Result Format**
120120

0 commit comments

Comments
 (0)