Decode a GraphQL response body against schema. The body may carry several
concatenated JSON documents (GraphQL incremental delivery — @defer/
@stream), so it is split and merged first; the requested root field may
therefore arrive in a later patch, and the answer's errors survive the
merge from whichever chunk carried them. A root field the server aliased is
also put under its exact name before decoding, so a schema written against
the field name reads it either way. The merged payload is then read by the
one verdict graphqlMutationAccepted reads: the server's refusal —
its errors beside no answer, an absent root field or a null one
included — is raised as a GraphqlServerError, and a payload with
neither the root field nor errors is a GraphqlRootFieldMissingError
— either rather than letting a raw parse/shape failure surface as a
TypeError downstream. A root field present with its value decodes, errors
beside it included.
Decode a GraphQL response body against
schema. The body may carry several concatenated JSON documents (GraphQL incremental delivery —@defer/@stream), so it is split and merged first; the requested root field may therefore arrive in a later patch, and the answer'serrorssurvive the merge from whichever chunk carried them. A root field the server aliased is also put under its exact name before decoding, so a schema written against the field name reads it either way. The merged payload is then read by the one verdict graphqlMutationAccepted reads: the server's refusal — itserrorsbeside no answer, an absent root field or anullone included — is raised as a GraphqlServerError, and a payload with neither the root field norerrorsis a GraphqlRootFieldMissingError — either rather than letting a raw parse/shape failure surface as aTypeErrordownstream. A root field present with its value decodes, errors beside it included.