-
When an error occurs in federation, even if it is a GraphqlError, the federation removes the "originalError" message when not in development. Is this expected? As an example, this is in dev {
"errors": [
{
"message": "Unexpected error.",
"extensions": {
"serviceName": "events",
"code": "DOWNSTREAM_SERVICE_ERROR",
"originalError": {
"message": "User identified by email \"[email protected]\" not found"
}
}
}
],
"data": null
} while this is in production {
"errors": [
{
"message": "Unexpected error.",
"extensions": {
"code": 404,
"serviceName": "events"
}
}
],
"data": null
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
Hey, @ramiel what you are experiencing is error masking which is a security measure to avoid leaking sensitive information. You can learn more here: https://the-guild.dev/graphql/yoga-server/docs/features/error-masking#customize-error-masking and https://the-guild.dev/graphql/yoga-server/docs/features/apollo-federation#handling-subgraph-errors for subgraph error handling. |
Beta Was this translation helpful? Give feedback.
-
This is exactly what I'm talking about. I'm using GraphqlError to let the message pass to the client. This is in fact working correctly in the service itself, but is masked when going through the gateway |
Beta Was this translation helpful? Give feedback.
Hey, @ramiel what you are experiencing is error masking which is a security measure to avoid leaking sensitive information. You can learn more here: https://the-guild.dev/graphql/yoga-server/docs/features/error-masking#customize-error-masking and https://the-guild.dev/graphql/yoga-server/docs/features/apollo-federation#handling-subgraph-errors for subgraph error handling.