1.8 KiB
title
| title |
|---|
| Rate Limiting |
Rate Limiting
The AnimeThemes GraphQL API applies the standard named rate limiter of the Laravel Framework.
Here we will provide an overview of managing request quotas.
Response Headers
The AnimeThemes GraphQL API limits 90 requests per minute.
The AnimeThemes API will return X-RateLimit-Limit and X-RateLimit-Remaining headers in the response.
...
X-RateLimit-Limit: 90
X-RateLimit-Remaining: 89
...
Exceeding the Rate Limit
If the rate limit is exceeded, the AnimeThemes API will return Retry-After and X-RateLimit-Reset headers in the response with a 429 status code.
...
X-RateLimit-Limit: 90
X-RateLimit-Remaining: 0
Retry-After: 60
X-RateLimit-Reset: 1625073463180
...
Additionally, the AnimeThemes API will return an error message in the response body.
{
message: "Too Many Attempts."
}
Query Depth Limit
Clients can nest fields within other fields, which can quickly result in deeply nested queries.
The AnimeThemes GraphQL API enforces a maximum query depth of 13.
If your query exceeds this limit, the API will return a 200 status code with the following error response:
{
"errors": [
{
"message": "Max query depth should be 13 but got 16."
}
]
}
Query Complexity Limit
Clients can request a lot of fields, which can quickly result in a lot of heavy logic.
The AnimeThemes GraphQL API enforces a maximum of 10000 of complexity value.
If your query exceeds this limit, the API will return a 200 status code with the following error response:
{
"errors": [
{
"message": "Max query complexity should be 10000 but got 15000."
}
]
}
::: warning The current complexity value is experimental and debatable. It may change. :::