Optisigns GraphQL API
Error Handling
GraphQL operations return errors in a standardized format:
- Each response may include an
errors
array - Each error contains:
message
: Human-readable error descriptionextensions
: Additional metadata and error codes
Always check the error object in the response rather than HTTP status codes. Examples below demonstrate common error scenarios.
Example 1: GraphQL Validation Error
Example 2: Device Already Paired Error
Explanation
- GraphQL Validation Error: This example shows an error when a field is queried incorrectly. It includes a message, location, and an error code.
- Device Already Paired Error: This example shows a business logic error with a specific status code and message.