Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: move "Path" to it's own section #1129

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions spec/Section 7 -- Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,8 @@ syntax element.
If an error can be associated to a particular field in the GraphQL result, it
must contain an entry with the key `path` that details the path of the response
field which experienced the error. This allows clients to identify whether a
`null` result is intentional or caused by a runtime error.

If present, this field must be a list of path segments starting at the root of
the response and ending with the field associated with the error. Path segments
that represent fields must be strings, and path segments that represent list
indices must be 0-indexed integers. If the error happens in an aliased field,
the path to the error must use the aliased name, since it represents a path in
the response, not in the request.
`null` result is intentional or caused by a runtime error. The value of this
field is described in the [Path](#sec-Path) section.

For example, if fetching one of the friends' names fails in the following
operation:
Expand Down Expand Up @@ -244,6 +238,19 @@ discouraged.
}
```

### Path

A `path` field allows for the association to a particular field in a GraphQL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we define that?

Suggested change
A `path` field allows for the association to a particular field in a GraphQL
:: A _path field_ allows for the association to a particular field in a GraphQL

result. This field must be a list of path segments starting at the root of the
response and ending with the field to be associated with. Path segments that
represent fields must be strings, and path segments that represent list indices
must be 0-indexed integers. If the path is associated to an aliased field, the
path must use the aliased name, since it represents a path in the response, not
in the request.

When the `path` field is present on an "Error result", it indicates the response
field which experienced the error.

## Serialization Format

GraphQL does not require a specific serialization format. However, clients
Expand Down
Loading