Skip to content

Commit 1d248b6

Browse files
committed
Editorial: move "Path" to it's own section
1 parent df1acea commit 1d248b6

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

spec/Section 7 -- Response.md

Lines changed: 15 additions & 8 deletions
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+
field 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,19 @@ discouraged.
244238
}
245239
```
246240

241+
### Path
242+
243+
A `path` field allows for the association to a particular field in a GraphQL
244+
result. This field must be a list of path segments starting at the root of the
245+
response and ending with the field to be associated with. Path segments that
246+
represent fields must be strings, and path segments that represent list indices
247+
must be 0-indexed integers. If the path is associated to an aliased field, the
248+
path must use the aliased name, since it represents a path in the response, not
249+
in the request.
250+
251+
When the `path` field is present on an "Error result", it indicates the response
252+
field which experienced the error.
253+
247254
## Serialization Format
248255

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

0 commit comments

Comments
 (0)