···11+---
22+"@urql/core": patch
33+---
44+55+Implement new `@defer` / `@stream` transport protocol spec changes.
+7-1
packages/core/src/internal/fetchSource.ts
···175175 throw new Error(await response.text());
176176 }
177177178178+ let pending: ExecutionResult['pending'];
178179 for await (const payload of results) {
180180+ if (payload.pending && !result) {
181181+ pending = payload.pending;
182182+ } else if (payload.pending) {
183183+ pending = [...pending!, ...payload.pending];
184184+ }
179185 result = result
180180- ? mergeResultPatch(result, payload, response)
186186+ ? mergeResultPatch(result, payload, response, pending)
181187 : makeResult(operation, payload, response);
182188 networkMode = false;
183189 yield result;
+26-1
packages/core/src/types.ts
···114114 [extension: string]: any;
115115}
116116117117+type Path = readonly (string | number)[];
118118+117119/** Incremental Payloads sent as part of "Incremental Delivery" patching prior result data.
118120 *
119121 * @remarks
···139141 * entry of the `path` will be an index number at which to start setting the range of
140142 * items.
141143 */
142142- path: readonly (string | number)[];
144144+ path?: Path;
145145+ /** An id pointing at an entry in the "pending" set of deferred results
146146+ *
147147+ * @remarks
148148+ * When we resolve this id it will give us the path to the deferred Fragment, this
149149+ * can be afterwards combined with the subPath to get the eventual location of the data.
150150+ */
151151+ id?: string;
152152+ /** A path array from the defer/stream fragment to the location of our data. */
153153+ subPath?: Path;
143154 /** Data to patch into the result data at the given `path`.
144155 *
145156 * @remarks
···172183 extensions?: Extensions;
173184}
174185186186+type PendingIncrementalResult = {
187187+ path: Path;
188188+ id: string;
189189+ label?: string;
190190+};
191191+175192export interface ExecutionResult {
193193+ /** Payloads we are still waiting for from the server.
194194+ *
195195+ * @remarks
196196+ * This was nely introduced in the defer/stream spec iteration of June 2023 https://github.com/graphql/defer-stream-wg/discussions/69
197197+ * Pending can be present on both Incremental as well as normal execution results, the presence of pending on an incremental
198198+ * result points at a nested deferred/streamed fragment.
199199+ */
200200+ pending?: readonly PendingIncrementalResult[];
176201 /** Incremental patches to be applied to a previous result as part of "Incremental Delivery".
177202 *
178203 * @remarks