Errors
Hygraph uses conventional HTTP responses codes when returning API requests.
Codes in the 2xx range refer to a successful request, whereas responses in the 4xx range indicate there was an error due to the information you provided, such as invalid query arguments, or auth token.
Code | Description |
---|---|
200 | OK - Successful response |
400 | Bad request - Typically due to invalid query arguments |
401 | Unauthorized - Usually no valid Permanent Auth Token was provided |
402 | Payment required - Typically due to an expired trial or API/assetTraffic exceeded |
403 | Unauthorized request - The user needs more permissions |
404 | Not Found - Typically invalid endpoint or environment requested |
429 | Too Many Requests - You're making too many requests, slow down |
500 | Internal Server Error - Something went wrong on our side |
A typical GraphQL error will look like the below. The format of the error is typical for any 400
query or mutation request.
{"errors": [{"message": "input:1: Field \"idd\" is not defined by type PostWhereInput. Did you mean id?\n"}],"data": null,"extensions": {"requestId": "ckff8k1tc0nsg0150cssdkzxm"}}
It's clear from the error above that the field idd
is not part of the Input Type.
Hygraph will also return the requestId
which can be used when requesting support.
#400: Bad request
Hygraph will return a 400 if there is an error with the request. 400 errors are typically thrown when there is a client-side validation error, such as a missing required argument in your GraphQL query, or a malformed Permanent Auth Token.
If your Permanent Auth Token is not a valid JWT, you will receive a 400 error.
#401: Unauthorized
The endpoint you requested requires a valid Permanent Auth Token, or a environment may not exist for this project.
You might find the following documents useful for this:
#402: Payment required
Exceeding the API operations and/or the asset traffic limit results in the API being blocked until the new billing period starts.
Queries will return the following 402 error:
You have exceeded the limits of your project's subscription. To continue using your API, please enable billing under your project's settings to allow for overlimit billing.
You may also get this error after a trial period has expired.
#403: Unauthorized request
The user needs more permissions for either the Content API or the Management API.
You might find the following documents useful for this:
#429: Too many requests
To ensure delivery of optimal experiences to all customers, a rate limit is enforced on all GraphQL queries for the shared regions.
The rate limiting depends on the current load of the shared region and the subscription plan. These limits can be lifted on dedicated clusters and enterprise plans. Please contact sales for further information.
You'll get a 429
when you exceed the rate limit, and you will get a response with the following payload:
{"errors": [{"message": "Too Many Requests"}],"data": null}
Our document on API rate limits shares information on limits according to subscription plan, as well as ways of handling API rate limits with Next.js, Gatsby, and Nuxt.
#500: Internal server error
500s
errors could happen in multiple scenarios, whenever there's something wrong on our side.
If you get a 500
error, make sure to take a look at our status page.