AniLink - v2.0.0
    Preparing search index...

    Function unwrapGraphQLResponse

    • 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 are single-root-field, so consumers of typed operations always receive the bare value; only custom multi-field documents surface the envelope shape.

      An envelope carrying a non-empty errors array (an HTTP 200 GraphQL failure) throws an AniLinkGraphQLError instead of returning data.

      Type Parameters

      • T

      Parameters

      • response: unknown

        The full GraphQL response envelope.

      Returns T

      The unwrapped single-root-field value, or the envelope as-is.

      An AniLinkGraphQLError when the envelope carries GraphQL errors.