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. When the envelope carries zero or multiple root fields, or no
data object at all, it returns undefined so callers can decide what to
do with a document whose shape does not match the single-root-field
contract.
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. When the envelope carries zero or multiple root fields, or nodataobject at all, it returnsundefinedso callers can decide what to do with a document whose shape does not match the single-root-field contract.