Skip to content

Commit e9ac8c8

Browse files
robrichardbenjie
andauthored
Editorial: move "Path" to it's own section (#1129)
* Editorial: move "Path" to it's own section * Define _path field_ * Apply suggestions from code review Co-authored-by: Benjie <[email protected]> * Apply suggestions from code review Co-authored-by: Benjie <[email protected]> --------- Co-authored-by: Benjie <[email protected]>
1 parent 2073bc8 commit e9ac8c8

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

spec/Section 7 -- Response.md

+17-8
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,8 @@ syntax element.
107107
If an error can be associated to a particular field in the GraphQL result, it
108108
must contain an entry with the key `path` that details the path of the response
109109
field 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.
110+
`null` result is intentional or caused by a runtime error. The value of this
111+
_path entry_ is described in the [Path](#sec-Path) section.
118112

119113
For example, if fetching one of the friends' names fails in the following
120114
operation:
@@ -244,6 +238,21 @@ discouraged.
244238
}
245239
```
246240

241+
### Path
242+
243+
:: A _path entry_ is an entry within an _error result_ that allows for
244+
association with a particular field reached during GraphQL execution.
245+
246+
The value for a _path entry_ must be a list of path segments starting at the
247+
root of the response and ending with the field to be associated with. Path
248+
segments that represent fields must be strings, and path segments that represent
249+
list indices must be 0-indexed integers. If a path segment is associated with an
250+
aliased field it must use the aliased name, since it represents a path in the
251+
response, not in the request.
252+
253+
When the _path entry_ is present on an _error result_, it identifies the
254+
response field which experienced the error.
255+
247256
## Serialization Format
248257

249258
GraphQL does not require a specific serialization format. However, clients

0 commit comments

Comments
 (0)