@@ -10,7 +10,12 @@ the case that any _field error_ was raised on a field and was replaced with
1010
1111## Response Format
1212
13- A response to a GraphQL request must be a map.
13+ A GraphQL request returns either a _ response_ or a _ response stream_ .
14+
15+ ### Response
16+
17+ :: A GraphQL request returns a _ response_ when the GraphQL operation is a query
18+ or mutation. A _ response_ must be a map.
1419
1520If the request raised any errors, the response map must contain an entry with
1621key ` errors ` . The value of this entry is described in the "Errors" section. If
@@ -35,6 +40,11 @@ Note: When `errors` is present in the response, it may be helpful for it to
3540appear first when serialized to make it more clear when errors are present in a
3641response during debugging.
3742
43+ ### Response Stream
44+
45+ :: A GraphQL request returns a _ response stream_ when the GraphQL operation is a
46+ subscription. A _ response stream_ must be a stream of _ response_ .
47+
3848### Data
3949
4050The ` data ` entry in the response will be the result of the execution of the
@@ -107,14 +117,8 @@ syntax element.
107117If an error can be associated to a particular field in the GraphQL result, it
108118must contain an entry with the key ` path ` that details the path of the response
109119field which experienced the error. This allows clients to identify whether a
110- ` null ` result is intentional or caused by a runtime error.
111-
112- If present, this field must be a list of path segments starting at the root of
113- the response and ending with the field associated with the error. Path segments
114- that represent fields must be strings, and path segments that represent list
115- indices must be 0-indexed integers. If the error happens in an aliased field,
116- the path to the error must use the aliased name, since it represents a path in
117- the response, not in the request.
120+ ` null ` result is intentional or caused by a runtime error. The value of this
121+ _ path entry_ is described in the [ Path] ( #sec-Path ) section.
118122
119123For example, if fetching one of the friends' names fails in the following
120124operation:
@@ -244,6 +248,21 @@ discouraged.
244248}
245249```
246250
251+ ### Path
252+
253+ :: A _ path entry_ is an entry within an _ error result_ that allows for
254+ association with a particular field reached during GraphQL execution.
255+
256+ The value for a _ path entry_ must be a list of path segments starting at the
257+ root of the response and ending with the field to be associated with. Path
258+ segments that represent fields must be strings, and path segments that represent
259+ list indices must be 0-indexed integers. If a path segment is associated with an
260+ aliased field it must use the aliased name, since it represents a path in the
261+ response, not in the request.
262+
263+ When the _ path entry_ is present on an _ error result_ , it identifies the
264+ response field which experienced the error.
265+
247266## Serialization Format
248267
249268GraphQL does not require a specific serialization format. However, clients
0 commit comments