Default GraphQL response is now HTTP 500
14 hours ago
- #GraphQL
- #HTTP Status Codes
- #Observability
- GraphQL is transitioning from returning HTTP 200 for all responses, including errors, to HTTP 500 by default to improve observability.
- The change addresses criticism that HTTP 200 made monitoring difficult, as it obscured failures in dashboards and tools.
- GraphQL previously used HTTP 200 because it supports partial data in responses, where errors and data coexist, making status codes insufficient.
- The new approach, starting October 2026, will use HTTP 500 for all responses to simplify error detection and encourage checking response bodies.
- A new 'everything_is_fine' boolean will be added to responses to indicate if data is usable, while the 'errors' array remains unchanged.
- The move aims to enhance monitoring, provide honest metrics, and improve developer practices by relying on response content over status codes.
- The announcement ends with a note about it being an April Fools' joke, but recommends using preferred status codes with the GraphQL content type and OpenTelemetry tracing.