Skip to content

Commit

Permalink
Clarify types of errors in spec text (#385)
Browse files Browse the repository at this point in the history
* Clarify types of errors in spec text

* Update Section 5 -- Validation.md
  • Loading branch information
IvanGoncharov authored and leebyron committed Apr 18, 2018
1 parent 0356f0c commit 1d56b88
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ the built-in scalar types should be omitted for brevity.

A GraphQL server, when preparing a field of a given scalar type, must uphold the
contract the scalar type describes, either by coercing the value or
producing an error.
producing a field error.

For example, a GraphQL server could be preparing a field with the scalar type
`Int` and encounter a floating-point number. Since the server must not break the
Expand Down Expand Up @@ -1263,7 +1263,7 @@ type of an Object or Interface field.
**Input Coercion**

The value for an input object should be an input object literal or an unordered
map supplied by a variable, otherwise an error must be thrown. In either
map supplied by a variable, otherwise a query error must be thrown. In either
case, the input object literal or unordered map must not contain any entries
with names not defined by a field of this input object type, otherwise an error
must be thrown.
Expand Down
6 changes: 3 additions & 3 deletions spec/Section 5 -- Validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -973,9 +973,9 @@ referenced.

**Explanatory Text**

Named fragment spreads must refer to fragments defined
within the document. If the target of a spread is
not defined, this is an error:
Named fragment spreads must refer to fragments defined within the
document. It is a validation error if the target of a spread is
not defined.

```graphql counter-example
{
Expand Down
5 changes: 3 additions & 2 deletions spec/Section 6 -- Execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -716,5 +716,6 @@ resolves to {null}, then the entire list must resolve to {null}.
If the `List` type is also wrapped in a `Non-Null`, the field error continues
to propagate upwards.

If all fields from the root of the request to the source of the error return
`Non-Null` types, then the {"data"} entry in the response should be {null}.
If all fields from the root of the request to the source of the field error
return `Non-Null` types, then the {"data"} entry in the response should
be {null}.
2 changes: 1 addition & 1 deletion spec/Section 7 -- Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ operation if successful, and describes any errors encountered during the
request.

A response may contain both a partial response as well as encountered errors in
the case that an error occurred on a field which was replaced with null.
the case that a field error occurred on a field which was replaced with null.


## Serialization Format
Expand Down

0 comments on commit 1d56b88

Please sign in to comment.