@@ -50,45 +50,47 @@ If an error was raised during the execution that prevented a valid response, the
50
50
51
51
### Errors
52
52
53
- The ` errors ` entry in the response is a non-empty list of errors, where each
54
- error is a map.
53
+ The ` errors ` entry in the response is a non-empty list of errors raised during
54
+ the _ request_ , where each error is a map of data described by the error result
55
+ format below.
55
56
56
- If no errors were raised during the request, the ` errors ` entry should not be
57
+ If present, the ` errors ` entry in the response must contain at least one error.
58
+ If no errors were raised during the request, the ` errors ` entry must not be
57
59
present in the result.
58
60
59
- If the ` data ` entry in the response is not present, the ` errors ` entry in the
60
- response must not be empty . It must contain at least one error. The errors it
61
- contains should indicate why no data was able to be returned.
61
+ If the ` data ` entry in the response is not present, the ` errors ` entry must be
62
+ present . It should contain at least one _ request error _ indicating why no data
63
+ was able to be returned.
62
64
63
65
If the ` data ` entry in the response is present (including if it is the value
64
- {null}), the ` errors ` entry in the response may contain a list of all _ field
65
- error_ that were raised during execution. If any _ field error_ was raised during
66
- execution, it should contain the ` errors ` entry.
66
+ {null}), the ` errors ` entry must also be present if a _ field error_ was raised
67
+ during execution.
67
68
68
69
** Request errors**
69
70
70
- :: A _ request error_ is an error raised during a _ request_ but before execution
71
- begins. This may occur due to a parse grammar or validation error in the
72
- _ Document _ , an inability to determine which operation to execute, or invalid
73
- input values for variables.
71
+ :: A _ request error_ is an error raised during a _ request_ which results in no
72
+ response data. Typically raised before execution begins, a request error may
73
+ occur due to a parse grammar or validation error in the _ Document _ , an inability
74
+ to determine which operation to execute, or invalid input values for variables.
74
75
75
76
A request error is typically the fault of the requesting client.
76
77
77
- If a request error is raised, execution does not begin and the ` data ` entry in
78
- the response must not be present. The ` errors ` entry must include the error.
78
+ If a request error is raised, the ` data ` entry in the response must not be
79
+ present. If a request error is encountered before execution, execution should
80
+ not begin. The ` errors ` entry must include the error.
79
81
80
82
** Field errors**
81
83
82
- :: A _ field error_ is raised during the execution of a particular field. This
83
- may occur due to an internal error during value resolution or failure to coerce
84
- the resulting value.
84
+ :: A _ field error_ is an error raised during the execution of a particular field
85
+ which results in partial response data. This may occur due to an internal error
86
+ during value resolution or failure to coerce the resulting value.
85
87
86
88
A field error is typically the fault of a GraphQL service.
87
89
88
90
If a field error is raised, execution attempts to continue and a partial result
89
91
is produced (see [ Handling Field Errors] ( #sec-Handling-Field-Errors ) ). The
90
- ` data ` entry in the response must be present. The ` errors ` entry should be a
91
- list of all raised field errors .
92
+ ` data ` entry in the response must be present. The ` errors ` entry should include
93
+ this error .
92
94
93
95
** Error result format**
94
96
0 commit comments