(body: unknown)
| 189 | // A gateway's `{ "errors": "Throttled" }` is not a GraphQL response, so its |
| 190 | // status and Retry-After still apply. |
| 191 | const isGraphQLBody = (body: unknown): boolean => |
| 192 | isObject(body) && ("data" in body || "errors" in body) && |
| 193 | (!("errors" in body) || Array.isArray(body.errors)) && |
| 194 | (!("data" in body) || body.data === null || isObject(body.data)) |
| 195 | |
| 196 | // The JSON body of a POST and the payload of a graphql-ws `subscribe`. |
| 197 | // `extensions` is dropped from the JSON when unset. |
no test coverage detected