The full GraphQL response envelope.
Optionalheaders: Record<string, unknown>
The response headers, when available, so rate-limit and
content-type metadata from the HTTP 200 envelope are preserved on the
thrown AniLinkGraphQLError (AniList returns x-ratelimit-* headers
even on envelopes carrying GraphQL-level errors).
Optionaloptions: UnwrapOptions
Partial-success controls; see UnwrapOptions.
The unwrapped single-root-field value, or the envelope as-is.
Unwraps a GraphQL response envelope.
This is the tolerant wrapper around unwrapSingleRootField used by the request pipeline. Documents with exactly one root field resolve to the bare field value; documents with multiple root fields (or none) are returned as the full envelope unchanged. All shipped operations use one root field, so typed operations return the bare value. Custom documents with multiple root fields return the envelope.
An envelope carrying a non-empty
errorsarray (an HTTP 200 GraphQL failure) throws anAniLinkGraphQLErrorinstead of returning data, unlessoptions.allowPartialDatais set and the envelope also carries a non-nulldataobject, in which case the data is returned and the error entries are reported throughoptions.onPartialDatawith the sameAniLinkGraphQLErrorthe strict mode would have thrown.