Add heading for error handling and point to spec
Fixes https://github.com/graphql-rust/juniper/issues/695.
This commit is contained in:
parent
3616e36ece
commit
5ddd2d499f
1 changed files with 6 additions and 0 deletions
|
@ -62,6 +62,11 @@ type all fields must return. By using the `?` operator or `try!` macro, any type
|
|||
that implements the `Display` trait - which are most of the error types out
|
||||
there - those errors are automatically converted into `FieldError`.
|
||||
|
||||
## Error payloads, `null`, and partial errors
|
||||
|
||||
Juniper's error behavior conforms to the [GraphQL specification](https://spec.graphql.org/June2018/#sec-Errors-and-Non-Nullability).
|
||||
|
||||
|
||||
When a field returns an error, the field's result is replaced by `null`, an
|
||||
additional `errors` object is created at the top level of the response, and the
|
||||
execution is resumed. For example, with the previous example and the following
|
||||
|
@ -124,6 +129,7 @@ following would be returned:
|
|||
}
|
||||
```
|
||||
|
||||
|
||||
### Structured errors
|
||||
|
||||
Sometimes it is desirable to return additional structured error information
|
||||
|
|
Loading…
Reference in a new issue