Unwraps the single root field of a GraphQL response envelope.
The AniList API returns every operation's result inside a { data } envelope.
For operations whose selection set has exactly one root field (for example
User, Media, or MediaListCollection), this helper returns the bare
field value. For responses with multiple root fields, or responses without
a data object (for example GraphQL errors), the full envelope is returned
unchanged.
Unwraps the single root field of a GraphQL response envelope.
The AniList API returns every operation's result inside a
{ data }envelope. For operations whose selection set has exactly one root field (for exampleUser,Media, orMediaListCollection), this helper returns the bare field value. For responses with multiple root fields, or responses without adataobject (for example GraphQL errors), the full envelope is returned unchanged.