01 Software

Error Handling

GraphQL error response format and error codes

Error Handling

Error Response Format

{
  "errors": [
    {
      "message": "Error message",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": ["Products"],
      "extensions": {
        "code": "UNAUTHENTICATED"
      }
    }
  ],
  "data": null
}

Common Error Codes

  • UNAUTHENTICATED - Authentication required
  • FORBIDDEN - Insufficient permissions
  • BAD_USER_INPUT - Invalid input
  • NOT_FOUND - Resource not found
  • INTERNAL_SERVER_ERROR - Server error

On this page