docs(graphql): add query complexity limit (#130)

This commit is contained in:
Kyrch
2026-04-10 01:11:15 -03:00
committed by GitHub
parent 28e734f661
commit 70512007ab
+21 -3
View File
@@ -12,7 +12,7 @@ Here we will provide an overview of managing request quotas.
## Response Headers
The AnimeThemes GraphQL API limits queries to 90 per minute.
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.
@@ -25,7 +25,7 @@ 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.
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.
```sh
...
@@ -50,7 +50,7 @@ Clients can nest fields within other fields, which can quickly result in deeply
The AnimeThemes GraphQL API enforces a maximum query depth of 13.
If your query exceeds this limit, the API will return the following error response:
If your query exceeds this limit, the API will return a 200 status code with the following error response:
```json
{
@@ -60,4 +60,22 @@ If your query exceeds this limit, the API will return the following error respon
}
]
}
```
## Query Complexity Limit
Clients can request a lot of fields, can nest fields within other fields, which can quickly result in deeply nested queries.
The AnimeThemes GraphQL API enforces a maximum of 250 fields per request.
If your query exceeds this limit, the API will return a 200 status code with the following error response:
```json
{
"errors": [
{
"message": "Max query complexity should be 250 but got 300."
}
]
}
```