Description
Failed-request detection in the Apollo 3, 4, and 5 integrations currently checks whether a response body contains an errors array. The current matcher also treats an empty array such as the following as a failure:
{
"data": {},
"errors": []
}
This results in false-positive Sentry events. Failed-request events should only be captured when the GraphQL errors array contains at least one entry.
Acceptance criteria
- Responses with an absent or empty
errors array do not produce failed-request events.
- Responses with one or more entries in
errors continue to produce failed-request events.
- Detection handles normal JSON whitespace and line breaks.
- Existing streaming-response and data-collection behavior remains unchanged.
- Unit tests cover empty and non-empty arrays in Apollo 3, 4, and 5.
Source: #6074 (comment)
Description
Failed-request detection in the Apollo 3, 4, and 5 integrations currently checks whether a response body contains an
errorsarray. The current matcher also treats an empty array such as the following as a failure:{ "data": {}, "errors": [] }This results in false-positive Sentry events. Failed-request events should only be captured when the GraphQL
errorsarray contains at least one entry.Acceptance criteria
errorsarray do not produce failed-request events.errorscontinue to produce failed-request events.Source: #6074 (comment)