litmus/mkdocs/docs/graphql/v3.10.0/error_response_guide.md

968 B

All error responses follow the structure outlined below.

{
  "errors": [
    {
      "message": "Error message",
      "path": [
        "Request path"
      ]
    }
  ],
  "data": {}
}

Field Descriptions:

  • errors:
    An array of error objects. Multiple errors can occur, and each error contains a message and a path field.
    Type: Array

    • message:
      A description of the error.
      Type: String

    • path:
      Indicates the GraphQL or API operation path where the error occurred. It helps in identifying which operation or resolver triggered the error.
      Type: Array of Strings

  • data:
    This field contains the data returned from the request. In the event of an error, the field corresponding to the failed operation will be null, while other successful operations (if any) will still return valid data.
    Type: Object