···11+/* Summary: This file handles the HTTP transport via GraphQL over HTTP
22+ * See: https://graphql.github.io/graphql-over-http/draft/
33+ *
44+ * `@urql/core`, by default, implements several RFC'd protocol extensions
55+ * on top of this. As such, this implementation supports:
66+ * - [Incremental Delivery](https://github.com/graphql/graphql-over-http/blob/main/rfcs/IncrementalDelivery.md)
77+ * - [GraphQL over SSE](https://github.com/graphql/graphql-over-http/blob/main/rfcs/GraphQLOverSSE.md)
88+ *
99+ * This also supports the "Defer Stream" payload format.
1010+ * See: https://github.com/graphql/graphql-wg/blob/main/rfcs/DeferStream.md
1111+ * Implementation for this is located in `../utils/result.ts` in `mergeResultPatch`
1212+ *
1313+ * And; this also supports the GraphQL Multipart spec for file uploads.
1414+ * See: https://github.com/jaydenseric/graphql-multipart-request-spec
1515+ * Implementation for this is located in `../utils/variables.ts` in `extractFiles`,
1616+ * and `./fetchOptions.ts` in `serializeBody`.
1717+ *
1818+ * And; this also supports GET requests (and hence; automatic persisted queries)
1919+ * via the `@urql/exchange-persisted` package.
2020+ *
2121+ * This implementation DOES NOT support Batching.
2222+ * See: https://github.com/graphql/graphql-over-http/blob/main/rfcs/Batching.md
2323+ * Which is deemed out-of-scope, as it's sufficiently unnecessary given
2424+ * modern handling of HTTP requests being in parallel.
2525+ *
2626+ * The implementation in this file needs to make certain accommodations for:
2727+ * - The Web Fetch API
2828+ * - Non-browser or polyfill Fetch APIs
2929+ * - Node.js-like Fetch implementations (see `toString` below)
3030+ *
3131+ * GraphQL over SSE has a reference implementation, which supports non-HTTP/2
3232+ * modes and is a faithful implementation of the spec.
3333+ * See: https://github.com/enisdenjo/graphql-sse
3434+ *
3535+ * GraphQL Inremental Delivery (aka “GraphQL Multipart Responses”) has a
3636+ * reference implementation, which a prior implementation of this file heavily
3737+ * leaned on (See prior attribution comments)
3838+ * See: https://github.com/maraisr/meros
3939+ *
4040+ * This file merges support for all three GraphQL over HTTP response formats
4141+ * via async generators and Wonka’s `fromAsyncIterable`. As part of this, `streamBody`
4242+ * and `split` are the common, cross-compatible base implementations.
4343+ */
4444+145import { Source, fromAsyncIterable, onEnd, filter, pipe } from 'wonka';
246import { Operation, OperationResult, ExecutionResult } from '../types';
347import { makeResult, makeErrorResult, mergeResultPatch } from '../utils';