AniLink - v3.1.0
    Preparing search index...

    Class AniLinkGraphQLError

    GraphQL-level failure returned inside an HTTP 200 envelope.

    The inherited AniLinkApiError.status reflects the upstream GraphQL error status when an entry in AniLinkGraphQLError.graphqlErrors carries one (for example 404 or 429), and the HTTP 200 envelope status otherwise. This makes status a meaningful classification field for GraphQL failures and lets status-based branching and retry policies treat a GraphQL-level 429/5xx like its HTTP-level counterpart. The 200 default is not an availability-class status: the circuit breaker treats a 200-defaulted GraphQL error as streak-neutral. It neither advances nor resets the failure streak, because the envelope proves the upstream answered while the status-less entries carry no upstream-health signal.

    Hierarchy (View Summary)

    Index
    • Creates a GraphQL error from an HTTP 200 envelope's errors array.

      Parameters

      • errors: readonly GraphQLUpstreamError[]

        The upstream GraphQL errors; each entry should carry a message.

      • Optionaldata: unknown

        The partial data object returned alongside the errors, when any. Exposed as AniLinkGraphQLError.partialData.

      • OptionalrawAxiosError: unknown

        The original Axios error when raw diagnostics are enabled.

      • Optionaloptions: { contentType?: string; rateLimit?: RateLimitInfo; requestId?: string }

        Additional error metadata such as rate-limit headers and the response content type. AniList returns rate-limit headers even on HTTP 200 envelopes carrying GraphQL errors (for example a GraphQL-level 429), so threading them here keeps AniLinkGraphQLError.rateLimit consistent with the HTTP-failure path.

      Returns AniLinkGraphQLError

    Stable code used to classify the failure.

    contentType?: string

    The Content-Type of the failing response, parsed from the upstream response headers. REST providers such as MyAnimeList return HTML or plain-text bodies on rate-limit and gateway error paths; this field lets consumers distinguish a structured JSON failure payload (where data.message is meaningful) from a non-JSON one without guessing. Absent when the response carried no Content-Type header.

    data: unknown

    Response body returned by the upstream API, preserved verbatim.

    graphqlErrors: readonly GraphQLUpstreamError[]

    The upstream GraphQL errors array carried by the envelope, preserved verbatim. Beyond message, entries typically carry an upstream status (distinguishing "entity does not exist" from a server fault) plus locations and extensions when AniList includes them.

    partialData?: unknown

    The partial data object returned alongside the GraphQL errors, when AniList produced a partial success. GraphQL can resolve some fields while failing others; the usable portion survives here (and on the inherited AniLinkApiError.data field) instead of being discarded, so consumers can recover the fields that did resolve.

    rateLimit?: RateLimitInfo

    Rate-limit accounting parsed from the x-ratelimit-limit, x-ratelimit-remaining, and x-ratelimit-reset response headers, whenever AniList includes all three. Use it to self-throttle before the next request instead of waiting for another 429. It is never included in the error message so logs stay clean.

    rawAxiosError?: unknown

    Original Axios or transport error when raw diagnostics were enabled.

    requestId?: string

    Library-generated correlation ID joining this failure to the onRequestStart/onResponse/onRetry/onError hook events it produced, so a caught error can be matched to its lifecycle stream in a metrics or logging backend. Absent on errors raised outside the request pipeline (for example validation errors thrown before any request is sent).

    status: number

    HTTP status returned by the upstream API. For GraphQL failures this is the upstream GraphQL error status when available, and the HTTP envelope status (200) otherwise.