mirror of
https://github.com/AnimeThemes/animethemes-api-docs.git
synced 2026-07-11 01:34:06 +02:00
docs(graphql): add query complexity limit (#130)
This commit is contained in:
@@ -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."
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user