diff --git a/docs/book/content/types/objects/error_handling.md b/docs/book/content/types/objects/error_handling.md index d42d2daf..d80201b7 100644 --- a/docs/book/content/types/objects/error_handling.md +++ b/docs/book/content/types/objects/error_handling.md @@ -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