AniList custom operations
The flexible custom AniList GraphQL operation, including its request and response contract.
Custom
anilist.custom
AniListCustom.custom runs an arbitrary GraphQL query or mutation against AniList, returning the raw response. Use it as an escape hatch when no typed operation fits: the query string is sent verbatim and the variables argument is forwarded as-is.
Signature
custom<T>(query: string, variables?: Record<string, unknown>, options?: RequestOptions): Promise<T>Auth: Not required — 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
const viewer = await aniLink.anilist.custom('query {Viewer {id}}');
const mutation = 'mutation ($about: String) {UpdateUser (about: $about) {id}}';
const variables = { about: "New about text" };
const response = await aniLink.anilist.custom(mutation, variables);