AniList custom operations
This page documents the custom AniList GraphQL operation's request and response contract.
Custom
anilist.custom
AniListCustom.custom sends a caller-authored GraphQL query or mutation document to AniList. Use it when no typed operation fits. The query string is sent verbatim and the variables argument is forwarded as-is. A document with a single root field resolves to the bare field value; a document with multiple root fields resolves to the full { data } envelope.
Signature
custom<T>(query: string, variables?: Record<string, unknown>, options?: RequestOptions): Promise<T>Auth: Not required for public data. Pass a token for viewer-scoped fields.
No parameters.
See the TypeDoc page for the full any shape.
AniLinkApiError:non-success AniList HTTP responseAniLinkGraphQLError:HTTP 200 response carrying GraphQL errorsAniLinkNetworkError:timeout, cancellation, or transport failure
Example
See the TypeDoc page for usage.
anilist.customPage
AniListCustom.customPage paginates a caller-authored Page document through the shared engine. Use it for collections whose field combination the generated page operations do not expose. The document must declare the standard AniList Page wrapper with $page/$perPage Int variables and select pageInfo { hasNextPage } plus an items array; the traversal reuses every engine guard (perPage clamping, the maxPages bound, look-ahead concurrency, AbortSignal forwarding, the lastPage terminal bound).
Signature
customPage<TPage, K>(query: string, itemsKey: K, variables?: Record<string, unknown>, options?: CustomPageOptions): Promise<PaginateResult<ArrayElement<TPage, K>>>Auth: Not required for public data. Pass a token for viewer-scoped fields.
No parameters.
See the TypeDoc page for the full any shape.
AniLinkApiError:non-success AniList HTTP responseAniLinkGraphQLError:HTTP 200 response carrying GraphQL errorsAniLinkNetworkError:timeout, cancellation, or transport failure
Example
See the TypeDoc page for usage.
Related guides
- Custom queries covers writing GraphQL documents.
- Field selection explains when to use
custom()instead.