relay-runtime 0.0.0-main-1ac62c2b → 0.0.0-main-716164ec
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/experimental.js +1 -1
- package/index.js +1 -1
- package/lib/store/OperationExecutor.js +14 -3
- package/package.json +1 -1
- package/store/OperationExecutor.js.flow +24 -4
package/experimental.js
CHANGED
package/index.js
CHANGED
|
@@ -328,9 +328,20 @@ var Executor = /*#__PURE__*/function () {
|
|
|
328
328
|
return ((_x$extensions = x.extensions) === null || _x$extensions === void 0 ? void 0 : _x$extensions.is_final) === true;
|
|
329
329
|
});
|
|
330
330
|
if (isFinal) {
|
|
331
|
-
this._state
|
|
332
|
-
|
|
333
|
-
|
|
331
|
+
if (this._useExecTimeResolvers && this._state !== 'loading_final' && responses.some(function (x) {
|
|
332
|
+
var _x$extensions2;
|
|
333
|
+
return ((_x$extensions2 = x.extensions) === null || _x$extensions2 === void 0 ? void 0 : _x$extensions2.is_normalized) === true;
|
|
334
|
+
})) {
|
|
335
|
+
this._execTimeResolverResponseComplete = true;
|
|
336
|
+
if (this._isClientQuery) {
|
|
337
|
+
this._state = 'loading_final';
|
|
338
|
+
}
|
|
339
|
+
this._updateActiveState();
|
|
340
|
+
} else {
|
|
341
|
+
this._state = 'loading_final';
|
|
342
|
+
this._updateActiveState();
|
|
343
|
+
this._incrementalPayloadsPending = false;
|
|
344
|
+
}
|
|
334
345
|
}
|
|
335
346
|
this._sink.next(response);
|
|
336
347
|
return;
|
package/package.json
CHANGED
|
@@ -515,12 +515,32 @@ class Executor<TMutation: MutationParameters> {
|
|
|
515
515
|
|
|
516
516
|
if (responsesWithData.length === 0) {
|
|
517
517
|
// no results with data, nothing to process
|
|
518
|
-
// this can occur with extensions-only payloads
|
|
518
|
+
// this can occur with extensions-only payloads, or exec time resolver
|
|
519
|
+
// responses
|
|
519
520
|
const isFinal = responses.some(x => x.extensions?.is_final === true);
|
|
520
521
|
if (isFinal) {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
522
|
+
if (
|
|
523
|
+
this._useExecTimeResolvers &&
|
|
524
|
+
this._state !== 'loading_final' &&
|
|
525
|
+
responses.some(x => x.extensions?.is_normalized === true)
|
|
526
|
+
) {
|
|
527
|
+
// An exec time resolver query can flush an empty response, if the
|
|
528
|
+
// same response has been included in other queries. Check if we need
|
|
529
|
+
// to mark the request as final
|
|
530
|
+
this._execTimeResolverResponseComplete = true;
|
|
531
|
+
// Need to update the active state to mark the query as inactive,
|
|
532
|
+
// incase server payloads have completed
|
|
533
|
+
if (this._isClientQuery) {
|
|
534
|
+
// If it is a client query, there is no server response to set the
|
|
535
|
+
// final state, so we need to set it here
|
|
536
|
+
this._state = 'loading_final';
|
|
537
|
+
}
|
|
538
|
+
this._updateActiveState();
|
|
539
|
+
} else {
|
|
540
|
+
this._state = 'loading_final';
|
|
541
|
+
this._updateActiveState();
|
|
542
|
+
this._incrementalPayloadsPending = false;
|
|
543
|
+
}
|
|
524
544
|
}
|
|
525
545
|
this._sink.next(response);
|
|
526
546
|
return;
|