Improved GraphQL errors
API
Effective October 31, 2019
Errors in GraphQL responses now contain extra metadata under the extensions
key. The error format follows the GraphQL specification.
The most notable metadata is the code
property which returns the error code. This feature allows you to more easily match on the types of errors without having to match on the full error message
.
For example:
{
"errors": [
{
"message": "Internal error. Looks like something went wrong on our end.",
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"requestId": "d2f47302-8559-4961-9a5b-3de60172aa29"
}
}
]
}