-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3eb6f4
commit e328293
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
### Add `extensions.service` for all subgraph errors ([PR #6191](https://github.com/apollographql/router/pull/6191)) | ||
|
||
If `include_subgraph_errors` is `true` for a particular subgraph, all errors originating in this subgraph will have the subgraph's name exposed as a `service` extension. | ||
|
||
For example, if subgraph errors are enabled, like so: | ||
```yaml title="router.yaml" | ||
include_subgraph_errors: | ||
all: true # Propagate errors from all subgraphs | ||
``` | ||
Note: This option is enabled by default in the [dev mode](./configuration/overview#dev-mode-defaults). | ||
And this `products` subgraph returns an error, it will have a `service` extension: | ||
|
||
```json | ||
{ | ||
"data": null, | ||
"errors": [ | ||
{ | ||
"message": "Invalid product ID", | ||
"path": [], | ||
"extensions": { | ||
"service": "products" | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
By [@IvanGoncharov](https://github.com/IvanGoncharov) in https://github.com/apollographql/router/pull/6191 |