In development mode, the Router is configured to be as verbose as possible, providing extensive information to help with debugging and troubleshooting. This mode exposes additional details about subgraph errors, making it easier to identify the root causes of issues.
Wrapped mode
By default, the Router operates in wrapped mode, where errors are encapsulated in a generic error object. This indicates a problem with the subgraph, while more detailed error information is provided in theerrors
field within the extensions
object.
Default Configuration
extensions
field is not exposed. In the extension object we only passthrough the code
field. For more detailed error output, you can modify the configuration as follow:
Extended Configuration Options
Example Error Response with Extended Configuration
attach_service_name
option allows the affected subgraph’s name to be sent to the client, which can help in generating more informative error messages.
Avoid exposing any information
The wrapped mode is useful when you want to avoid exposing additional information about subgraph errors to the client. This mode provides a generic error response without revealing specific details. You can enable this by using the following configuration: ConfigurationPassthrough mode
The **pass-through **mode returns errors exactly as they are received from the subgraph, without modification. This mode is commonly used in the GraphQL ecosystem to provide more transparency in error responses. As described in the previous section, you can fine-tune what information is exposed by adjusting the configuration.Propagate only selected fields
You can also fine tune which fields are propagated withallowed_fields
. The following ones are always propagated
message
path
omit_extensions
is set to true
(default is false
), extensions
will not be propagated.
If omit_locations
is set to true
(default is false
), locations
will not be propagated.
Configuration