Docs
Launch GraphOS Studio

Subgraph error inclusion


By default, the redacts the details of errors in its responses to clients. The router instead returns a default error with the following message:

Subgraph errors redacted

This redaction prevents potential leaks of sensitive information to the client. Using the include_subgraph_errors plugin, you can configure the to propagate subgraph errors to clients instead. You can do this for all subgraphs, or on a per-subgraph basis.

Configuration

To configure subgraph error inclusion, add the include_subgraph_errors plugin to your YAML config file, like so:

router.yaml
include_subgraph_errors:
all: true # Propagate errors from all subgraphs
subgraphs:
products: false # Do not propagate errors from the products subgraph

Any configuration under the subgraphs key takes precedence over configuration under the all key. In the example above, subgraph errors are included from all subgraphs except the products subgraph.

Sending errors to GraphOS

To report the subgraph errors to that is a separate configuration that is not affected by client subgraph error inclusion, see the GraphOS reporting docs.

Logging GraphQL request errors

To log the error responses (i.e. messages returned in the GraphQL errors array) from the router, see the logging configuration documentation.

Previous
Telemetry
Next
Header propagation
Edit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy

Company