mirror of
https://github.com/AnimeThemes/animethemes-api-docs.git
synced 2026-07-11 01:34:06 +02:00
docs: update rate limiting to 90 queries per request (#127)
This commit is contained in:
@@ -13,7 +13,7 @@ An external resource may be linked to multiple anime.
|
||||
## Query Example
|
||||
|
||||
```graphql
|
||||
query ($id: Int!) {
|
||||
query ($id: [Int!]) {
|
||||
findAnimeByExternalSite(site: ANILIST, id: $id) {
|
||||
name
|
||||
mediaFormat
|
||||
@@ -29,11 +29,11 @@ None
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :---: | :-----------: | :------------------------------------------------------------------------ |
|
||||
| site | ResourceSite! | The site enum used to filter. |
|
||||
| id | Int | The id of the anime in the external site. Required if no `link` provided. |
|
||||
| link | String | The URL of the external resource. Required if no `id` provided. |
|
||||
| Name | Type | Description |
|
||||
| :---: | :-----------: | :------------------------------------------------------------------------- |
|
||||
| site | ResourceSite! | The site enum used to filter. |
|
||||
| id | [Int!] | The ids of the anime on the external site. Required if no `link` provided. |
|
||||
| link | String | The URL of the external resource. Required if no `id` provided. |
|
||||
|
||||
## Response
|
||||
|
||||
|
||||
@@ -10,31 +10,20 @@ The AnimeThemes API implements relationships for most types, previously known as
|
||||
|
||||
The many-to-many relationships apply connections. The one-to-many relationships apply simple pagination.
|
||||
|
||||
## One-to-Many (HasMany)
|
||||
## One-to-Many
|
||||
|
||||
A one-to-many relationship has a list of objects that reference the related type.
|
||||
|
||||
```graphql
|
||||
query {
|
||||
anime(slug: "hibike_euphonium") {
|
||||
name
|
||||
animethemes(first: 2, type: OP) {
|
||||
sequence
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Inverse One-to-Many (BelongsTo)
|
||||
|
||||
An inverse one-to-many relationship has an object that references the foreign type.
|
||||
And an inverse one-to-many relationship has a unique object that references the related type.
|
||||
|
||||
```graphql
|
||||
query {
|
||||
animethemePagination {
|
||||
data {
|
||||
sequence
|
||||
anime {
|
||||
animethemeentries(first: 1, version: 1) { # Inverse One-to-Many
|
||||
version
|
||||
}
|
||||
anime { # One-to-Many
|
||||
name
|
||||
}
|
||||
}
|
||||
@@ -42,7 +31,7 @@ query {
|
||||
}
|
||||
```
|
||||
|
||||
## Many-to-Many (BelongsToMany)
|
||||
## Many-to-Many
|
||||
|
||||
Every many-to-many relationship applies connection pagination and has three top fields.
|
||||
Read about it in the [graphql.org](https://graphql.org/learn/pagination/#pagination-and-edges)
|
||||
@@ -112,7 +101,7 @@ will return the JSON:
|
||||
}
|
||||
```
|
||||
|
||||
## Polymorphic One-to-Many (MorphMany)
|
||||
## Polymorphic One-to-Many
|
||||
|
||||
The relationship of polymorphic one-to-many. Applies simple pagination.
|
||||
|
||||
@@ -129,7 +118,7 @@ query {
|
||||
}
|
||||
```
|
||||
|
||||
## Polymorphic inverse One-to-Many (MorphTo)
|
||||
## Polymorphic inverse One-to-Many
|
||||
|
||||
The inverse type of polymorphic one-to-many.
|
||||
A union type indicates that a field might have multiple object types.
|
||||
@@ -139,6 +128,7 @@ query {
|
||||
performancePagination {
|
||||
data {
|
||||
artist {
|
||||
__typename
|
||||
... on Artist {
|
||||
name
|
||||
}
|
||||
@@ -156,7 +146,7 @@ query {
|
||||
}
|
||||
```
|
||||
|
||||
## Polymorphic Many-to-Many (MorphToMany)
|
||||
## Polymorphic Many-to-Many
|
||||
|
||||
The polymorphic many-to-many relationship uses the same strategy as the usual [many-to-many](#many-to-many-belongstomany).
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ Here we will provide an overview of managing request quotas.
|
||||
|
||||
## Response Headers
|
||||
|
||||
The AnimeThemes GraphQL API limits queries to 80 per minute.
|
||||
The AnimeThemes GraphQL API limits queries to 90 per minute.
|
||||
|
||||
The AnimeThemes API will return `X-RateLimit-Limit` and `X-RateLimit-Remaining` headers in the response.
|
||||
|
||||
```sh
|
||||
...
|
||||
X-RateLimit-Limit: 80
|
||||
X-RateLimit-Remaining: 79
|
||||
X-RateLimit-Limit: 90
|
||||
X-RateLimit-Remaining: 89
|
||||
...
|
||||
```
|
||||
|
||||
@@ -29,7 +29,7 @@ If the rate limit is exceeded, the AnimeThemes API will return `Retry-After` and
|
||||
|
||||
```sh
|
||||
...
|
||||
X-RateLimit-Limit: 80
|
||||
X-RateLimit-Limit: 90
|
||||
X-RateLimit-Remaining: 0
|
||||
Retry-After: 60
|
||||
X-RateLimit-Reset: 1625073463180
|
||||
|
||||
@@ -44,7 +44,7 @@ For more information, see the [wiki section on performances and memberships](htt
|
||||
|
||||
It is easy to confuse what a group is. They can be a group of animethemes (e.g. "English Version") or a group of artists (e.g. "Aqours").
|
||||
|
||||
The `group` query/type does not exist. For a group of animethemes, the query is `themegroups`. For a group of artists, they are included globally in the `artists` query.
|
||||
The `group` query/type does not exist. For a group of animethemes, the query is `themegroupPagination`. For a group of artists, they are included globally in the `artistPagination` query.
|
||||
|
||||
## Views Count Field Deprecated
|
||||
|
||||
|
||||
Reference in New Issue
Block a user