relay-runtime 11.0.1 → 13.0.0-rc.1

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.
Files changed (169) hide show
  1. package/handlers/RelayDefaultHandlerProvider.js.flow +2 -2
  2. package/handlers/connection/ConnectionHandler.js.flow +8 -17
  3. package/handlers/connection/MutationHandlers.js.flow +7 -11
  4. package/index.js +1 -1
  5. package/index.js.flow +60 -36
  6. package/lib/handlers/RelayDefaultHandlerProvider.js +1 -1
  7. package/lib/handlers/connection/ConnectionHandler.js +13 -19
  8. package/lib/handlers/connection/MutationHandlers.js +4 -7
  9. package/lib/index.js +58 -43
  10. package/lib/multi-actor-environment/ActorIdentifier.js +33 -0
  11. package/lib/multi-actor-environment/ActorSpecificEnvironment.js +152 -0
  12. package/lib/multi-actor-environment/ActorUtils.js +27 -0
  13. package/lib/multi-actor-environment/MultiActorEnvironment.js +419 -0
  14. package/lib/multi-actor-environment/MultiActorEnvironmentTypes.js +11 -0
  15. package/lib/multi-actor-environment/index.js +21 -0
  16. package/lib/mutations/RelayDeclarativeMutationConfig.js +4 -1
  17. package/lib/mutations/RelayRecordProxy.js +3 -2
  18. package/lib/mutations/RelayRecordSourceMutator.js +3 -2
  19. package/lib/mutations/RelayRecordSourceProxy.js +12 -4
  20. package/lib/mutations/RelayRecordSourceSelectorProxy.js +18 -5
  21. package/lib/mutations/applyOptimisticMutation.js +6 -6
  22. package/lib/mutations/commitMutation.js +14 -10
  23. package/lib/mutations/readUpdatableQuery_EXPERIMENTAL.js +238 -0
  24. package/lib/mutations/validateMutation.js +10 -5
  25. package/lib/network/ConvertToExecuteFunction.js +2 -1
  26. package/lib/network/RelayNetwork.js +3 -2
  27. package/lib/network/RelayQueryResponseCache.js +21 -5
  28. package/lib/network/wrapNetworkWithLogObserver.js +79 -0
  29. package/lib/query/GraphQLTag.js +3 -2
  30. package/lib/query/fetchQuery.js +6 -5
  31. package/lib/query/fetchQueryInternal.js +1 -1
  32. package/lib/query/fetchQuery_DEPRECATED.js +2 -1
  33. package/lib/store/ClientID.js +7 -1
  34. package/lib/store/DataChecker.js +123 -54
  35. package/lib/store/{RelayModernQueryExecutor.js → OperationExecutor.js} +518 -200
  36. package/lib/store/RelayConcreteVariables.js +26 -8
  37. package/lib/store/RelayExperimentalGraphResponseHandler.js +153 -0
  38. package/lib/store/RelayExperimentalGraphResponseTransform.js +391 -0
  39. package/lib/store/RelayModernEnvironment.js +175 -240
  40. package/lib/store/RelayModernFragmentSpecResolver.js +52 -26
  41. package/lib/store/RelayModernOperationDescriptor.js +2 -1
  42. package/lib/store/RelayModernRecord.js +47 -12
  43. package/lib/store/RelayModernSelector.js +14 -8
  44. package/lib/store/RelayModernStore.js +56 -28
  45. package/lib/store/RelayOperationTracker.js +34 -24
  46. package/lib/store/RelayPublishQueue.js +41 -13
  47. package/lib/store/RelayReader.js +288 -48
  48. package/lib/store/RelayRecordSource.js +87 -3
  49. package/lib/store/RelayReferenceMarker.js +34 -22
  50. package/lib/store/RelayResponseNormalizer.js +211 -110
  51. package/lib/store/RelayStoreReactFlightUtils.js +4 -10
  52. package/lib/store/RelayStoreSubscriptions.js +14 -9
  53. package/lib/store/RelayStoreUtils.js +12 -7
  54. package/lib/store/ResolverCache.js +213 -0
  55. package/lib/store/ResolverFragments.js +61 -0
  56. package/lib/store/cloneRelayHandleSourceField.js +5 -4
  57. package/lib/store/cloneRelayScalarHandleSourceField.js +5 -4
  58. package/lib/store/createRelayContext.js +4 -2
  59. package/lib/store/readInlineData.js +6 -2
  60. package/lib/subscription/requestSubscription.js +34 -25
  61. package/lib/util/RelayConcreteNode.js +3 -0
  62. package/lib/util/RelayFeatureFlags.js +10 -4
  63. package/lib/util/RelayProfiler.js +17 -187
  64. package/lib/util/RelayReplaySubject.js +22 -7
  65. package/lib/util/RelayRuntimeTypes.js +0 -6
  66. package/lib/util/StringInterner.js +71 -0
  67. package/lib/util/getFragmentIdentifier.js +15 -7
  68. package/lib/util/getOperation.js +2 -1
  69. package/lib/util/getPaginationMetadata.js +41 -0
  70. package/lib/util/getPaginationVariables.js +66 -0
  71. package/lib/util/getPendingOperationsForFragment.js +55 -0
  72. package/lib/util/getRefetchMetadata.js +36 -0
  73. package/lib/util/getRelayHandleKey.js +2 -2
  74. package/lib/util/getRequestIdentifier.js +2 -2
  75. package/lib/util/getValueAtPath.js +51 -0
  76. package/lib/util/isEmptyObject.js +1 -1
  77. package/lib/util/registerEnvironmentWithDevTools.js +26 -0
  78. package/lib/util/withDuration.js +31 -0
  79. package/multi-actor-environment/ActorIdentifier.js.flow +43 -0
  80. package/multi-actor-environment/ActorSpecificEnvironment.js.flow +225 -0
  81. package/multi-actor-environment/ActorUtils.js.flow +33 -0
  82. package/multi-actor-environment/MultiActorEnvironment.js.flow +506 -0
  83. package/multi-actor-environment/MultiActorEnvironmentTypes.js.flow +261 -0
  84. package/multi-actor-environment/index.js.flow +26 -0
  85. package/mutations/RelayDeclarativeMutationConfig.js.flow +32 -26
  86. package/mutations/RelayRecordProxy.js.flow +4 -5
  87. package/mutations/RelayRecordSourceMutator.js.flow +4 -6
  88. package/mutations/RelayRecordSourceProxy.js.flow +19 -10
  89. package/mutations/RelayRecordSourceSelectorProxy.js.flow +22 -7
  90. package/mutations/applyOptimisticMutation.js.flow +13 -14
  91. package/mutations/commitLocalUpdate.js.flow +1 -1
  92. package/mutations/commitMutation.js.flow +35 -46
  93. package/mutations/readUpdatableQuery_EXPERIMENTAL.js.flow +309 -0
  94. package/mutations/validateMutation.js.flow +26 -16
  95. package/network/ConvertToExecuteFunction.js.flow +2 -2
  96. package/network/RelayNetwork.js.flow +4 -5
  97. package/network/RelayNetworkTypes.js.flow +5 -4
  98. package/network/RelayObservable.js.flow +1 -1
  99. package/network/RelayQueryResponseCache.js.flow +34 -21
  100. package/network/wrapNetworkWithLogObserver.js.flow +100 -0
  101. package/package.json +3 -2
  102. package/query/GraphQLTag.js.flow +9 -9
  103. package/query/PreloadableQueryRegistry.js.flow +2 -1
  104. package/query/fetchQuery.js.flow +11 -13
  105. package/query/fetchQueryInternal.js.flow +6 -9
  106. package/query/fetchQuery_DEPRECATED.js.flow +6 -6
  107. package/relay-runtime.js +2 -2
  108. package/relay-runtime.min.js +2 -2
  109. package/store/ClientID.js.flow +14 -3
  110. package/store/DataChecker.js.flow +141 -59
  111. package/store/{RelayModernQueryExecutor.js.flow → OperationExecutor.js.flow} +605 -303
  112. package/store/RelayConcreteVariables.js.flow +27 -8
  113. package/store/RelayExperimentalGraphResponseHandler.js.flow +124 -0
  114. package/store/RelayExperimentalGraphResponseTransform.js.flow +475 -0
  115. package/store/RelayModernEnvironment.js.flow +173 -240
  116. package/store/RelayModernFragmentSpecResolver.js.flow +55 -31
  117. package/store/RelayModernOperationDescriptor.js.flow +12 -7
  118. package/store/RelayModernRecord.js.flow +67 -11
  119. package/store/RelayModernSelector.js.flow +24 -14
  120. package/store/RelayModernStore.js.flow +66 -36
  121. package/store/RelayOperationTracker.js.flow +59 -43
  122. package/store/RelayOptimisticRecordSource.js.flow +2 -2
  123. package/store/RelayPublishQueue.js.flow +79 -34
  124. package/store/RelayReader.js.flow +351 -73
  125. package/store/RelayRecordSource.js.flow +72 -6
  126. package/store/RelayReferenceMarker.js.flow +40 -26
  127. package/store/RelayResponseNormalizer.js.flow +258 -99
  128. package/store/RelayStoreReactFlightUtils.js.flow +4 -11
  129. package/store/RelayStoreSubscriptions.js.flow +19 -11
  130. package/store/RelayStoreTypes.js.flow +209 -43
  131. package/store/RelayStoreUtils.js.flow +24 -11
  132. package/store/ResolverCache.js.flow +249 -0
  133. package/store/ResolverFragments.js.flow +121 -0
  134. package/store/StoreInspector.js.flow +2 -2
  135. package/store/TypeID.js.flow +1 -1
  136. package/store/ViewerPattern.js.flow +2 -2
  137. package/store/cloneRelayHandleSourceField.js.flow +5 -6
  138. package/store/cloneRelayScalarHandleSourceField.js.flow +5 -6
  139. package/store/createFragmentSpecResolver.js.flow +3 -4
  140. package/store/createRelayContext.js.flow +3 -3
  141. package/store/normalizeRelayPayload.js.flow +6 -7
  142. package/store/readInlineData.js.flow +7 -8
  143. package/subscription/requestSubscription.js.flow +53 -41
  144. package/util/NormalizationNode.js.flow +10 -3
  145. package/util/ReaderNode.js.flow +38 -2
  146. package/util/RelayConcreteNode.js.flow +5 -0
  147. package/util/RelayFeatureFlags.js.flow +24 -10
  148. package/util/RelayProfiler.js.flow +22 -194
  149. package/util/RelayReplaySubject.js.flow +9 -9
  150. package/util/RelayRuntimeTypes.js.flow +72 -3
  151. package/util/StringInterner.js.flow +69 -0
  152. package/util/createPayloadFor3DField.js.flow +3 -3
  153. package/util/getFragmentIdentifier.js.flow +27 -15
  154. package/util/getOperation.js.flow +2 -2
  155. package/util/getPaginationMetadata.js.flow +72 -0
  156. package/util/getPaginationVariables.js.flow +108 -0
  157. package/util/getPendingOperationsForFragment.js.flow +62 -0
  158. package/util/getRefetchMetadata.js.flow +79 -0
  159. package/util/getRelayHandleKey.js.flow +1 -2
  160. package/util/getRequestIdentifier.js.flow +3 -3
  161. package/util/getValueAtPath.js.flow +46 -0
  162. package/util/isEmptyObject.js.flow +1 -0
  163. package/util/registerEnvironmentWithDevTools.js.flow +33 -0
  164. package/util/resolveImmediate.js.flow +1 -1
  165. package/util/withDuration.js.flow +32 -0
  166. package/lib/store/RelayRecordSourceMapImpl.js +0 -107
  167. package/lib/store/RelayStoreSubscriptionsUsingMapByID.js +0 -318
  168. package/store/RelayRecordSourceMapImpl.js.flow +0 -91
  169. package/store/RelayStoreSubscriptionsUsingMapByID.js.flow +0 -283
@@ -17,40 +17,49 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
17
17
 
18
18
  var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
19
19
 
20
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
21
-
22
- var RelayError = require('../util/RelayError');
20
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
21
 
24
- var RelayFeatureFlags = require('../util/RelayFeatureFlags');
25
-
26
- var RelayModernRecord = require('./RelayModernRecord');
22
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
27
23
 
28
24
  var RelayObservable = require('../network/RelayObservable');
29
25
 
30
- var RelayRecordSource = require('./RelayRecordSource');
31
-
32
- var RelayResponseNormalizer = require('./RelayResponseNormalizer');
26
+ var generateID = require('../util/generateID');
33
27
 
34
28
  var getOperation = require('../util/getOperation');
35
29
 
36
- var invariant = require("fbjs/lib/invariant");
30
+ var RelayError = require('../util/RelayError');
31
+
32
+ var RelayFeatureFlags = require('../util/RelayFeatureFlags');
37
33
 
38
34
  var stableCopy = require('../util/stableCopy');
39
35
 
40
- var warning = require("fbjs/lib/warning");
36
+ var withDuration = require('../util/withDuration');
41
37
 
42
38
  var _require = require('./ClientID'),
43
39
  generateClientID = _require.generateClientID,
44
40
  generateUniqueClientID = _require.generateUniqueClientID;
45
41
 
46
- var _require2 = require('./RelayModernSelector'),
47
- createNormalizationSelector = _require2.createNormalizationSelector,
48
- createReaderSelector = _require2.createReaderSelector;
42
+ var _require2 = require('./RelayConcreteVariables'),
43
+ getLocalVariables = _require2.getLocalVariables;
44
+
45
+ var RelayModernRecord = require('./RelayModernRecord');
46
+
47
+ var _require3 = require('./RelayModernSelector'),
48
+ createNormalizationSelector = _require3.createNormalizationSelector,
49
+ createReaderSelector = _require3.createReaderSelector;
50
+
51
+ var RelayRecordSource = require('./RelayRecordSource');
52
+
53
+ var RelayResponseNormalizer = require('./RelayResponseNormalizer');
54
+
55
+ var _require4 = require('./RelayStoreUtils'),
56
+ ROOT_TYPE = _require4.ROOT_TYPE,
57
+ TYPENAME_KEY = _require4.TYPENAME_KEY,
58
+ getStorageKey = _require4.getStorageKey;
49
59
 
50
- var _require3 = require('./RelayStoreUtils'),
51
- ROOT_TYPE = _require3.ROOT_TYPE,
52
- TYPENAME_KEY = _require3.TYPENAME_KEY,
53
- getStorageKey = _require3.getStorageKey;
60
+ var invariant = require('invariant');
61
+
62
+ var warning = require("fbjs/lib/warning");
54
63
 
55
64
  function execute(config) {
56
65
  return new Executor(config);
@@ -66,27 +75,51 @@ var Executor = /*#__PURE__*/function () {
66
75
  function Executor(_ref) {
67
76
  var _this = this;
68
77
 
69
- var operation = _ref.operation,
78
+ var actorIdentifier = _ref.actorIdentifier,
79
+ getDataID = _ref.getDataID,
80
+ getPublishQueue = _ref.getPublishQueue,
81
+ getStore = _ref.getStore,
82
+ isClientPayload = _ref.isClientPayload,
83
+ operation = _ref.operation,
70
84
  operationExecutions = _ref.operationExecutions,
71
85
  operationLoader = _ref.operationLoader,
86
+ operationTracker = _ref.operationTracker,
72
87
  optimisticConfig = _ref.optimisticConfig,
73
- publishQueue = _ref.publishQueue,
88
+ _reactFlightPayloadDeserializer = _ref.reactFlightPayloadDeserializer,
89
+ reactFlightServerErrorHandler = _ref.reactFlightServerErrorHandler,
74
90
  scheduler = _ref.scheduler,
91
+ shouldProcessClientComponents = _ref.shouldProcessClientComponents,
75
92
  sink = _ref.sink,
76
93
  source = _ref.source,
77
- store = _ref.store,
78
- updater = _ref.updater,
79
- operationTracker = _ref.operationTracker,
80
94
  treatMissingFieldsAsNull = _ref.treatMissingFieldsAsNull,
81
- getDataID = _ref.getDataID,
82
- isClientPayload = _ref.isClientPayload,
83
- reactFlightPayloadDeserializer = _ref.reactFlightPayloadDeserializer,
84
- reactFlightServerErrorHandler = _ref.reactFlightServerErrorHandler,
85
- shouldProcessClientComponents = _ref.shouldProcessClientComponents;
95
+ updater = _ref.updater,
96
+ log = _ref.log;
97
+ (0, _defineProperty2["default"])(this, "_deserializeReactFlightPayloadWithLogging", function (tree) {
98
+ var reactFlightPayloadDeserializer = _this._reactFlightPayloadDeserializer;
99
+ !(typeof reactFlightPayloadDeserializer === 'function') ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected reactFlightPayloadDeserializer to be available when calling _deserializeReactFlightPayloadWithLogging.') : invariant(false) : void 0;
100
+
101
+ var _withDuration = withDuration(function () {
102
+ return reactFlightPayloadDeserializer(tree);
103
+ }),
104
+ duration = _withDuration[0],
105
+ result = _withDuration[1];
106
+
107
+ _this._log({
108
+ name: 'execute.flight.payload_deserialize',
109
+ executeId: _this._executeId,
110
+ operationName: _this._operation.request.node.params.name,
111
+ duration: duration
112
+ });
113
+
114
+ return result;
115
+ });
116
+ this._actorIdentifier = actorIdentifier;
86
117
  this._getDataID = getDataID;
87
118
  this._treatMissingFieldsAsNull = treatMissingFieldsAsNull;
88
119
  this._incrementalPayloadsPending = false;
89
120
  this._incrementalResults = new Map();
121
+ this._log = log;
122
+ this._executeId = generateID();
90
123
  this._nextSubscriptionId = 0;
91
124
  this._operation = operation;
92
125
  this._operationExecutions = operationExecutions;
@@ -95,19 +128,22 @@ var Executor = /*#__PURE__*/function () {
95
128
  this._operationUpdateEpochs = new Map();
96
129
  this._optimisticUpdates = null;
97
130
  this._pendingModulePayloadsCount = 0;
98
- this._publishQueue = publishQueue;
131
+ this._getPublishQueue = getPublishQueue;
99
132
  this._scheduler = scheduler;
100
133
  this._sink = sink;
101
134
  this._source = new Map();
102
135
  this._state = 'started';
103
- this._store = store;
136
+ this._getStore = getStore;
104
137
  this._subscriptions = new Map();
105
138
  this._updater = updater;
106
139
  this._isClientPayload = isClientPayload === true;
107
- this._reactFlightPayloadDeserializer = reactFlightPayloadDeserializer;
140
+ this._reactFlightPayloadDeserializer = _reactFlightPayloadDeserializer;
108
141
  this._reactFlightServerErrorHandler = reactFlightServerErrorHandler;
109
142
  this._isSubscriptionOperation = this._operation.request.node.params.operationKind === 'subscription';
110
143
  this._shouldProcessClientComponents = shouldProcessClientComponents;
144
+ this._retainDisposables = new Map();
145
+ this._seenActors = new Set();
146
+ this._completeFns = [];
111
147
  var id = this._nextSubscriptionId++;
112
148
  source.subscribe({
113
149
  complete: function complete() {
@@ -124,7 +160,17 @@ var Executor = /*#__PURE__*/function () {
124
160
  }
125
161
  },
126
162
  start: function start(subscription) {
127
- return _this._start(id, subscription);
163
+ var _this$_operation$requ;
164
+
165
+ _this._start(id, subscription);
166
+
167
+ _this._log({
168
+ name: 'execute.start',
169
+ executeId: _this._executeId,
170
+ params: _this._operation.request.node.params,
171
+ variables: _this._operation.request.variables,
172
+ cacheConfig: (_this$_operation$requ = _this._operation.request.cacheConfig) !== null && _this$_operation$requ !== void 0 ? _this$_operation$requ : {}
173
+ });
128
174
  }
129
175
  });
130
176
 
@@ -162,21 +208,25 @@ var Executor = /*#__PURE__*/function () {
162
208
  if (optimisticUpdates !== null) {
163
209
  this._optimisticUpdates = null;
164
210
  optimisticUpdates.forEach(function (update) {
165
- return _this2._publishQueue.revertUpdate(update);
166
- });
211
+ return _this2._getPublishQueueAndSaveActor().revertUpdate(update);
212
+ }); // OK: run revert on cancel
167
213
 
168
- this._publishQueue.run();
214
+ this._runPublishQueue();
169
215
  }
170
216
 
171
217
  this._incrementalResults.clear();
172
218
 
173
- this._completeOperationTracker();
219
+ if (this._asyncStoreUpdateDisposable != null) {
220
+ this._asyncStoreUpdateDisposable.dispose();
174
221
 
175
- if (this._retainDisposable) {
176
- this._retainDisposable.dispose();
177
-
178
- this._retainDisposable = null;
222
+ this._asyncStoreUpdateDisposable = null;
179
223
  }
224
+
225
+ this._completeFns = [];
226
+
227
+ this._completeOperationTracker();
228
+
229
+ this._disposeRetainedData();
180
230
  };
181
231
 
182
232
  _proto._updateActiveState = function _updateActiveState() {
@@ -209,7 +259,7 @@ var Executor = /*#__PURE__*/function () {
209
259
 
210
260
  default:
211
261
  this._state;
212
- !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernQueryExecutor: invalid executor state.') : invariant(false) : void 0;
262
+ !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: invalid executor state.') : invariant(false) : void 0;
213
263
  }
214
264
 
215
265
  this._operationExecutions.set(this._operation.request.identifier, activeState);
@@ -258,6 +308,11 @@ var Executor = /*#__PURE__*/function () {
258
308
  this.cancel();
259
309
 
260
310
  this._sink.complete();
311
+
312
+ this._log({
313
+ name: 'execute.complete',
314
+ executeId: this._executeId
315
+ });
261
316
  }
262
317
  };
263
318
 
@@ -265,6 +320,12 @@ var Executor = /*#__PURE__*/function () {
265
320
  this.cancel();
266
321
 
267
322
  this._sink.error(error);
323
+
324
+ this._log({
325
+ name: 'execute.error',
326
+ executeId: this._executeId,
327
+ error: error
328
+ });
268
329
  };
269
330
 
270
331
  _proto._start = function _start(id, subscription) {
@@ -278,9 +339,19 @@ var Executor = /*#__PURE__*/function () {
278
339
  var _this4 = this;
279
340
 
280
341
  this._schedule(function () {
281
- _this4._handleNext(response);
282
-
283
- _this4._maybeCompleteSubscriptionOperationTracking();
342
+ var _withDuration2 = withDuration(function () {
343
+ _this4._handleNext(response);
344
+
345
+ _this4._maybeCompleteSubscriptionOperationTracking();
346
+ }),
347
+ duration = _withDuration2[0];
348
+
349
+ _this4._log({
350
+ name: 'execute.next',
351
+ executeId: _this4._executeId,
352
+ response: response,
353
+ duration: duration
354
+ });
284
355
  });
285
356
  };
286
357
 
@@ -332,7 +403,7 @@ var Executor = /*#__PURE__*/function () {
332
403
 
333
404
  return ((_responsePart$extensi = responsePart.extensions) === null || _responsePart$extensi === void 0 ? void 0 : _responsePart$extensi.isOptimistic) === true;
334
405
  })) {
335
- !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'Optimistic responses cannot be batched.') : invariant(false) : void 0;
406
+ !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Optimistic responses cannot be batched.') : invariant(false) : void 0;
336
407
  }
337
408
 
338
409
  return false;
@@ -342,7 +413,7 @@ var Executor = /*#__PURE__*/function () {
342
413
  var isOptimistic = ((_response$extensions = response.extensions) === null || _response$extensions === void 0 ? void 0 : _response$extensions.isOptimistic) === true;
343
414
 
344
415
  if (isOptimistic && this._state !== 'started') {
345
- !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernQueryExecutor: optimistic payload received after server payload.') : invariant(false) : void 0;
416
+ !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: optimistic payload received after server payload.') : invariant(false) : void 0;
346
417
  }
347
418
 
348
419
  if (isOptimistic) {
@@ -361,6 +432,8 @@ var Executor = /*#__PURE__*/function () {
361
432
  return;
362
433
  }
363
434
 
435
+ this._seenActors.clear();
436
+
364
437
  var responses = Array.isArray(response) ? response : [response];
365
438
 
366
439
  var responsesWithData = this._handleErrorResponse(responses);
@@ -396,7 +469,9 @@ var Executor = /*#__PURE__*/function () {
396
469
 
397
470
  var _partitionGraphQLResp = partitionGraphQLResponses(responsesWithData),
398
471
  nonIncrementalResponses = _partitionGraphQLResp[0],
399
- incrementalResponses = _partitionGraphQLResp[1]; // In theory this doesn't preserve the ordering of the batch.
472
+ incrementalResponses = _partitionGraphQLResp[1];
473
+
474
+ var hasNonIncrementalResponses = nonIncrementalResponses.length > 0; // In theory this doesn't preserve the ordering of the batch.
400
475
  // The idea is that a batch is always:
401
476
  // * at most one non-incremental payload
402
477
  // * followed by zero or more incremental payloads
@@ -404,44 +479,64 @@ var Executor = /*#__PURE__*/function () {
404
479
  // with the initial payload followed by some early-to-resolve incremental
405
480
  // payloads (although, can that even happen?)
406
481
 
482
+ if (hasNonIncrementalResponses) {
483
+ // For subscriptions, to avoid every new payload from overwriting existing
484
+ // data from previous payloads, assign a unique rootID for every new
485
+ // non-incremental payload.
486
+ if (this._isSubscriptionOperation) {
487
+ var nextID = generateUniqueClientID();
488
+ this._operation = {
489
+ request: this._operation.request,
490
+ fragment: createReaderSelector(this._operation.fragment.node, nextID, this._operation.fragment.variables, this._operation.fragment.owner),
491
+ root: createNormalizationSelector(this._operation.root.node, nextID, this._operation.root.variables)
492
+ };
493
+ }
407
494
 
408
- if (nonIncrementalResponses.length > 0) {
409
- var payloadFollowups = this._processResponses(nonIncrementalResponses); // Please note that we're passing `this._operation` to the publish
410
- // queue here, which will later passed to the store (via notify)
411
- // to indicate that this is an operation that caused the store to update
412
-
413
-
414
- var updatedOwners = this._publishQueue.run(this._operation);
415
-
416
- this._updateOperationTracker(updatedOwners);
495
+ var payloadFollowups = this._processResponses(nonIncrementalResponses);
417
496
 
418
497
  this._processPayloadFollowups(payloadFollowups);
419
-
420
- if (this._incrementalPayloadsPending && !this._retainDisposable) {
421
- this._retainDisposable = this._store.retain(this._operation);
422
- }
423
498
  }
424
499
 
425
500
  if (incrementalResponses.length > 0) {
426
- var _payloadFollowups = this._processIncrementalResponses(incrementalResponses); // For the incremental case, we're only handling follow-up responses
427
- // for already initiated operation (and we're not passing it to
428
- // the run(...) call)
501
+ var _payloadFollowups = this._processIncrementalResponses(incrementalResponses);
429
502
 
503
+ this._processPayloadFollowups(_payloadFollowups);
504
+ }
430
505
 
431
- var _updatedOwners = this._publishQueue.run();
506
+ if (this._isSubscriptionOperation) {
507
+ // We attach the id to allow the `requestSubscription` to read from the store using
508
+ // the current id in its `onNext` callback
509
+ if (responsesWithData[0].extensions == null) {
510
+ // $FlowFixMe[cannot-write]
511
+ responsesWithData[0].extensions = {
512
+ __relay_subscription_root_id: this._operation.fragment.dataID
513
+ };
514
+ } else {
515
+ responsesWithData[0].extensions.__relay_subscription_root_id = this._operation.fragment.dataID;
516
+ }
517
+ } // OK: run once after each new payload
518
+ // If we have non-incremental responses, we passing `this._operation` to
519
+ // the publish queue here, which will later be passed to the store (via
520
+ // notify) to indicate that this operation caused the store to update
432
521
 
433
- this._updateOperationTracker(_updatedOwners);
434
522
 
435
- this._processPayloadFollowups(_payloadFollowups);
523
+ var updatedOwners = this._runPublishQueue(hasNonIncrementalResponses ? this._operation : undefined);
524
+
525
+ if (hasNonIncrementalResponses) {
526
+ if (this._incrementalPayloadsPending) {
527
+ this._retainData();
528
+ }
436
529
  }
437
530
 
531
+ this._updateOperationTracker(updatedOwners);
532
+
438
533
  this._sink.next(response);
439
534
  };
440
535
 
441
536
  _proto._processOptimisticResponse = function _processOptimisticResponse(response, updater, treatMissingFieldsAsNull) {
442
537
  var _this6 = this;
443
538
 
444
- !(this._optimisticUpdates === null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'environment.execute: only support one optimistic response per ' + 'execute.') : invariant(false) : void 0;
539
+ !(this._optimisticUpdates === null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: environment.execute: only support one optimistic response per ' + 'execute.') : invariant(false) : void 0;
445
540
 
446
541
  if (response == null && updater == null) {
447
542
  return;
@@ -451,9 +546,10 @@ var Executor = /*#__PURE__*/function () {
451
546
 
452
547
  if (response) {
453
548
  var payload = normalizeResponse(response, this._operation.root, ROOT_TYPE, {
549
+ actorIdentifier: this._actorIdentifier,
454
550
  getDataID: this._getDataID,
455
551
  path: [],
456
- reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer,
552
+ reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer != null ? this._deserializeReactFlightPayloadWithLogging : null,
457
553
  reactFlightServerErrorHandler: this._reactFlightServerErrorHandler,
458
554
  shouldProcessClientComponents: this._shouldProcessClientComponents,
459
555
  treatMissingFieldsAsNull: treatMissingFieldsAsNull
@@ -473,7 +569,7 @@ var Executor = /*#__PURE__*/function () {
473
569
  errors: null,
474
570
  fieldPayloads: null,
475
571
  incrementalPlaceholders: null,
476
- moduleImportPayloads: null,
572
+ followupPayloads: null,
477
573
  source: RelayRecordSource.create(),
478
574
  isFinal: false
479
575
  },
@@ -483,32 +579,47 @@ var Executor = /*#__PURE__*/function () {
483
579
 
484
580
  this._optimisticUpdates = optimisticUpdates;
485
581
  optimisticUpdates.forEach(function (update) {
486
- return _this6._publishQueue.applyUpdate(update);
487
- });
582
+ return _this6._getPublishQueueAndSaveActor().applyUpdate(update);
583
+ }); // OK: only called on construction and when receiving an optimistic payload from network,
584
+ // which doesn't fall-through to the regular next() handling
488
585
 
489
- this._publishQueue.run();
586
+ this._runPublishQueue();
490
587
  };
491
588
 
492
589
  _proto._processOptimisticFollowups = function _processOptimisticFollowups(payload, optimisticUpdates) {
493
- if (payload.moduleImportPayloads && payload.moduleImportPayloads.length) {
494
- var moduleImportPayloads = payload.moduleImportPayloads;
495
- var operationLoader = this._operationLoader;
496
- !operationLoader ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected an operationLoader to be ' + 'configured when using `@match`.') : invariant(false) : void 0;
590
+ if (payload.followupPayloads && payload.followupPayloads.length) {
591
+ var followupPayloads = payload.followupPayloads;
497
592
 
498
- var _iterator = (0, _createForOfIteratorHelper2["default"])(moduleImportPayloads),
593
+ var _iterator = (0, _createForOfIteratorHelper2["default"])(followupPayloads),
499
594
  _step;
500
595
 
501
596
  try {
502
597
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
503
- var moduleImportPayload = _step.value;
504
- var operation = operationLoader.get(moduleImportPayload.operationReference);
598
+ var followupPayload = _step.value;
599
+
600
+ switch (followupPayload.kind) {
601
+ case 'ModuleImportPayload':
602
+ var operationLoader = this._expectOperationLoader();
603
+
604
+ var operation = operationLoader.get(followupPayload.operationReference);
605
+
606
+ if (operation == null) {
607
+ this._processAsyncOptimisticModuleImport(followupPayload);
608
+ } else {
609
+ var moduleImportOptimisticUpdates = this._processOptimisticModuleImport(operation, followupPayload);
610
+
611
+ optimisticUpdates.push.apply(optimisticUpdates, (0, _toConsumableArray2["default"])(moduleImportOptimisticUpdates));
612
+ }
505
613
 
506
- if (operation == null) {
507
- this._processAsyncOptimisticModuleImport(operationLoader, moduleImportPayload);
508
- } else {
509
- var moduleImportOptimisticUpdates = this._processOptimisticModuleImport(operation, moduleImportPayload);
614
+ break;
510
615
 
511
- optimisticUpdates.push.apply(optimisticUpdates, (0, _toConsumableArray2["default"])(moduleImportOptimisticUpdates));
616
+ case 'ActorPayload':
617
+ process.env.NODE_ENV !== "production" ? warning(false, 'OperationExecutor: Unexpected optimistic ActorPayload. These updates are not supported.') : void 0;
618
+ break;
619
+
620
+ default:
621
+ followupPayload;
622
+ !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Unexpected followup kind `%s`. when processing optimistic updates.', followupPayload.kind) : invariant(false) : void 0;
512
623
  }
513
624
  }
514
625
  } catch (err) {
@@ -517,16 +628,29 @@ var Executor = /*#__PURE__*/function () {
517
628
  _iterator.f();
518
629
  }
519
630
  }
520
- };
631
+ }
632
+ /**
633
+ * Normalize Data for @module payload, and actor-specific payload
634
+ */
635
+ ;
636
+
637
+ _proto._normalizeFollowupPayload = function _normalizeFollowupPayload(followupPayload, normalizationNode) {
638
+ var variables;
639
+
640
+ if (normalizationNode.kind === 'SplitOperation' && followupPayload.kind === 'ModuleImportPayload') {
641
+ variables = getLocalVariables(followupPayload.variables, normalizationNode.argumentDefinitions, followupPayload.args);
642
+ } else {
643
+ variables = followupPayload.variables;
644
+ }
521
645
 
522
- _proto._normalizeModuleImport = function _normalizeModuleImport(moduleImportPayload, operation) {
523
- var selector = createNormalizationSelector(operation, moduleImportPayload.dataID, moduleImportPayload.variables);
646
+ var selector = createNormalizationSelector(normalizationNode, followupPayload.dataID, variables);
524
647
  return normalizeResponse({
525
- data: moduleImportPayload.data
526
- }, selector, moduleImportPayload.typeName, {
648
+ data: followupPayload.data
649
+ }, selector, followupPayload.typeName, {
650
+ actorIdentifier: this._actorIdentifier,
527
651
  getDataID: this._getDataID,
528
- path: moduleImportPayload.path,
529
- reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer,
652
+ path: followupPayload.path,
653
+ reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer != null ? this._deserializeReactFlightPayloadWithLogging : null,
530
654
  reactFlightServerErrorHandler: this._reactFlightServerErrorHandler,
531
655
  treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
532
656
  shouldProcessClientComponents: this._shouldProcessClientComponents
@@ -537,7 +661,7 @@ var Executor = /*#__PURE__*/function () {
537
661
  var operation = getOperation(normalizationRootNode);
538
662
  var optimisticUpdates = [];
539
663
 
540
- var modulePayload = this._normalizeModuleImport(moduleImportPayload, operation);
664
+ var modulePayload = this._normalizeFollowupPayload(moduleImportPayload, operation);
541
665
 
542
666
  validateOptimisticResponsePayload(modulePayload);
543
667
  optimisticUpdates.push({
@@ -551,10 +675,10 @@ var Executor = /*#__PURE__*/function () {
551
675
  return optimisticUpdates;
552
676
  };
553
677
 
554
- _proto._processAsyncOptimisticModuleImport = function _processAsyncOptimisticModuleImport(operationLoader, moduleImportPayload) {
678
+ _proto._processAsyncOptimisticModuleImport = function _processAsyncOptimisticModuleImport(moduleImportPayload) {
555
679
  var _this7 = this;
556
680
 
557
- operationLoader.load(moduleImportPayload.operationReference).then(function (operation) {
681
+ this._expectOperationLoader().load(moduleImportPayload.operationReference).then(function (operation) {
558
682
  if (operation == null || _this7._state !== 'started') {
559
683
  return;
560
684
  }
@@ -562,17 +686,18 @@ var Executor = /*#__PURE__*/function () {
562
686
  var moduleImportOptimisticUpdates = _this7._processOptimisticModuleImport(operation, moduleImportPayload);
563
687
 
564
688
  moduleImportOptimisticUpdates.forEach(function (update) {
565
- return _this7._publishQueue.applyUpdate(update);
689
+ return _this7._getPublishQueueAndSaveActor().applyUpdate(update);
566
690
  });
567
691
 
568
692
  if (_this7._optimisticUpdates == null) {
569
- process.env.NODE_ENV !== "production" ? warning(false, 'RelayModernQueryExecutor: Unexpected ModuleImport optimistic ' + 'update in operation %s.' + _this7._operation.request.node.params.name) : void 0;
693
+ process.env.NODE_ENV !== "production" ? warning(false, 'OperationExecutor: Unexpected ModuleImport optimistic ' + 'update in operation %s.' + _this7._operation.request.node.params.name) : void 0;
570
694
  } else {
571
695
  var _this$_optimisticUpda;
572
696
 
573
- (_this$_optimisticUpda = _this7._optimisticUpdates).push.apply(_this$_optimisticUpda, (0, _toConsumableArray2["default"])(moduleImportOptimisticUpdates));
697
+ (_this$_optimisticUpda = _this7._optimisticUpdates).push.apply(_this$_optimisticUpda, (0, _toConsumableArray2["default"])(moduleImportOptimisticUpdates)); // OK: always have to run() after an module import resolves async
574
698
 
575
- _this7._publishQueue.run();
699
+
700
+ _this7._runPublishQueue();
576
701
  }
577
702
  });
578
703
  };
@@ -582,7 +707,7 @@ var Executor = /*#__PURE__*/function () {
582
707
 
583
708
  if (this._optimisticUpdates !== null) {
584
709
  this._optimisticUpdates.forEach(function (update) {
585
- return _this8._publishQueue.revertUpdate(update);
710
+ _this8._getPublishQueueAndSaveActor().revertUpdate(update);
586
711
  });
587
712
 
588
713
  this._optimisticUpdates = null;
@@ -596,15 +721,16 @@ var Executor = /*#__PURE__*/function () {
596
721
 
597
722
  return responses.map(function (payloadPart) {
598
723
  var relayPayload = normalizeResponse(payloadPart, _this8._operation.root, ROOT_TYPE, {
724
+ actorIdentifier: _this8._actorIdentifier,
599
725
  getDataID: _this8._getDataID,
600
726
  path: [],
601
- reactFlightPayloadDeserializer: _this8._reactFlightPayloadDeserializer,
727
+ reactFlightPayloadDeserializer: _this8._reactFlightPayloadDeserializer != null ? _this8._deserializeReactFlightPayloadWithLogging : null,
602
728
  reactFlightServerErrorHandler: _this8._reactFlightServerErrorHandler,
603
729
  treatMissingFieldsAsNull: _this8._treatMissingFieldsAsNull,
604
730
  shouldProcessClientComponents: _this8._shouldProcessClientComponents
605
731
  });
606
732
 
607
- _this8._publishQueue.commitPayload(_this8._operation, relayPayload, _this8._updater);
733
+ _this8._getPublishQueueAndSaveActor().commitPayload(_this8._operation, relayPayload, _this8._updater);
608
734
 
609
735
  return relayPayload;
610
736
  });
@@ -624,7 +750,7 @@ var Executor = /*#__PURE__*/function () {
624
750
 
625
751
  payloads.forEach(function (payload) {
626
752
  var incrementalPlaceholders = payload.incrementalPlaceholders,
627
- moduleImportPayloads = payload.moduleImportPayloads,
753
+ followupPayloads = payload.followupPayloads,
628
754
  isFinal = payload.isFinal;
629
755
  _this9._state = isFinal ? 'loading_final' : 'loading_incremental';
630
756
 
@@ -634,18 +760,30 @@ var Executor = /*#__PURE__*/function () {
634
760
  _this9._incrementalPayloadsPending = false;
635
761
  }
636
762
 
637
- if (moduleImportPayloads && moduleImportPayloads.length !== 0) {
638
- var operationLoader = _this9._operationLoader;
639
- !operationLoader ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected an operationLoader to be ' + 'configured when using `@match`.') : invariant(false) : void 0;
640
- moduleImportPayloads.forEach(function (moduleImportPayload) {
641
- _this9._processModuleImportPayload(moduleImportPayload, operationLoader);
763
+ if (followupPayloads && followupPayloads.length !== 0) {
764
+ followupPayloads.forEach(function (followupPayload) {
765
+ var _followupPayload$acto;
766
+
767
+ var prevActorIdentifier = _this9._actorIdentifier;
768
+ _this9._actorIdentifier = (_followupPayload$acto = followupPayload.actorIdentifier) !== null && _followupPayload$acto !== void 0 ? _followupPayload$acto : _this9._actorIdentifier;
769
+
770
+ _this9._processFollowupPayload(followupPayload);
771
+
772
+ _this9._actorIdentifier = prevActorIdentifier;
642
773
  });
643
774
  }
644
775
 
645
776
  if (incrementalPlaceholders && incrementalPlaceholders.length !== 0) {
646
777
  _this9._incrementalPayloadsPending = _this9._state !== 'loading_final';
647
778
  incrementalPlaceholders.forEach(function (incrementalPlaceholder) {
779
+ var _incrementalPlacehold;
780
+
781
+ var prevActorIdentifier = _this9._actorIdentifier;
782
+ _this9._actorIdentifier = (_incrementalPlacehold = incrementalPlaceholder.actorIdentifier) !== null && _incrementalPlacehold !== void 0 ? _incrementalPlacehold : _this9._actorIdentifier;
783
+
648
784
  _this9._processIncrementalPlaceholder(payload, incrementalPlaceholder);
785
+
786
+ _this9._actorIdentifier = prevActorIdentifier;
649
787
  });
650
788
 
651
789
  if (_this9._isClientPayload || _this9._state === 'loading_final') {
@@ -667,10 +805,6 @@ var Executor = /*#__PURE__*/function () {
667
805
  });
668
806
 
669
807
  if (relayPayloads.length > 0) {
670
- var updatedOwners = _this9._publishQueue.run();
671
-
672
- _this9._updateOperationTracker(updatedOwners);
673
-
674
808
  _this9._processPayloadFollowups(relayPayloads);
675
809
  }
676
810
  }
@@ -686,15 +820,6 @@ var Executor = /*#__PURE__*/function () {
686
820
  if (this._pendingModulePayloadsCount === 0 && this._incrementalPayloadsPending === false) {
687
821
  this._completeOperationTracker();
688
822
  }
689
-
690
- if (RelayFeatureFlags.ENABLE_UNIQUE_SUBSCRIPTION_ROOT) {
691
- var nextID = generateUniqueClientID();
692
- this._operation = {
693
- request: this._operation.request,
694
- fragment: createReaderSelector(this._operation.fragment.node, nextID, this._operation.fragment.variables, this._operation.fragment.owner),
695
- root: createNormalizationSelector(this._operation.root.node, nextID, this._operation.root.variables)
696
- };
697
- }
698
823
  }
699
824
  /**
700
825
  * Processes a ModuleImportPayload, asynchronously resolving the normalization
@@ -705,68 +830,140 @@ var Executor = /*#__PURE__*/function () {
705
830
  */
706
831
  ;
707
832
 
708
- _proto._processModuleImportPayload = function _processModuleImportPayload(moduleImportPayload, operationLoader) {
833
+ _proto._processFollowupPayload = function _processFollowupPayload(followupPayload) {
709
834
  var _this10 = this;
710
835
 
711
- var node = operationLoader.get(moduleImportPayload.operationReference);
712
-
713
- if (node != null) {
714
- var operation = getOperation(node); // If the operation module is available synchronously, normalize the
715
- // data synchronously.
716
-
717
- this._handleModuleImportPayload(moduleImportPayload, operation);
718
-
719
- this._maybeCompleteSubscriptionOperationTracking();
720
- } else {
721
- // Otherwise load the operation module and schedule a task to normalize
722
- // the data when the module is available.
723
- var _id3 = this._nextSubscriptionId++;
724
-
725
- this._pendingModulePayloadsCount++;
726
-
727
- var decrementPendingCount = function decrementPendingCount() {
728
- _this10._pendingModulePayloadsCount--;
729
-
730
- _this10._maybeCompleteSubscriptionOperationTracking();
731
- }; // Observable.from(operationLoader.load()) wouldn't catch synchronous
732
- // errors thrown by the load function, which is user-defined. Guard
733
- // against that with Observable.from(new Promise(<work>)).
734
-
735
-
736
- RelayObservable.from(new Promise(function (resolve, reject) {
737
- operationLoader.load(moduleImportPayload.operationReference).then(resolve, reject);
738
- })).map(function (operation) {
739
- if (operation != null) {
740
- _this10._schedule(function () {
741
- _this10._handleModuleImportPayload(moduleImportPayload, getOperation(operation));
836
+ switch (followupPayload.kind) {
837
+ case 'ModuleImportPayload':
838
+ var operationLoader = this._expectOperationLoader();
839
+
840
+ var node = operationLoader.get(followupPayload.operationReference);
841
+
842
+ if (node != null) {
843
+ // If the operation module is available synchronously, normalize the
844
+ // data synchronously.
845
+ this._processFollowupPayloadWithNormalizationNode(followupPayload, getOperation(node));
846
+ } else {
847
+ // Otherwise load the operation module and schedule a task to normalize
848
+ // the data when the module is available.
849
+ var _id3 = this._nextSubscriptionId++;
850
+
851
+ this._pendingModulePayloadsCount++;
852
+
853
+ var decrementPendingCount = function decrementPendingCount() {
854
+ _this10._pendingModulePayloadsCount--;
855
+
856
+ _this10._maybeCompleteSubscriptionOperationTracking();
857
+ }; // Observable.from(operationLoader.load()) wouldn't catch synchronous
858
+ // errors thrown by the load function, which is user-defined. Guard
859
+ // against that with Observable.from(new Promise(<work>)).
860
+
861
+
862
+ var networkObservable = RelayObservable.from(new Promise(function (resolve, reject) {
863
+ operationLoader.load(followupPayload.operationReference).then(resolve, reject);
864
+ }));
865
+ RelayObservable.create(function (sink) {
866
+ var cancellationToken;
867
+ var subscription = networkObservable.subscribe({
868
+ next: function next(loadedNode) {
869
+ if (loadedNode != null) {
870
+ var publishModuleImportPayload = function publishModuleImportPayload() {
871
+ try {
872
+ var operation = getOperation(loadedNode);
873
+ var batchAsyncModuleUpdatesFN = RelayFeatureFlags.BATCH_ASYNC_MODULE_UPDATES_FN;
874
+ var shouldScheduleAsyncStoreUpdate = batchAsyncModuleUpdatesFN != null && _this10._pendingModulePayloadsCount > 1;
875
+
876
+ var _withDuration3 = withDuration(function () {
877
+ _this10._handleFollowupPayload(followupPayload, operation); // OK: always have to run after an async module import resolves
878
+
879
+
880
+ // OK: always have to run after an async module import resolves
881
+ if (shouldScheduleAsyncStoreUpdate) {
882
+ _this10._scheduleAsyncStoreUpdate( // $FlowFixMe[incompatible-call] `shouldScheduleAsyncStoreUpdate` check should cover `null` case
883
+ batchAsyncModuleUpdatesFN, sink.complete);
884
+ } else {
885
+ var updatedOwners = _this10._runPublishQueue();
886
+
887
+ _this10._updateOperationTracker(updatedOwners);
888
+ }
889
+ }),
890
+ duration = _withDuration3[0];
891
+
892
+ _this10._log({
893
+ name: 'execute.async.module',
894
+ executeId: _this10._executeId,
895
+ operationName: operation.name,
896
+ duration: duration
897
+ });
898
+
899
+ if (!shouldScheduleAsyncStoreUpdate) {
900
+ sink.complete();
901
+ }
902
+ } catch (error) {
903
+ sink.error(error);
904
+ }
905
+ };
906
+
907
+ var scheduler = _this10._scheduler;
908
+
909
+ if (scheduler == null) {
910
+ publishModuleImportPayload();
911
+ } else {
912
+ cancellationToken = scheduler.schedule(publishModuleImportPayload);
913
+ }
914
+ } else {
915
+ sink.complete();
916
+ }
917
+ },
918
+ error: sink.error
919
+ });
920
+ return function () {
921
+ subscription.unsubscribe();
922
+
923
+ if (_this10._scheduler != null && cancellationToken != null) {
924
+ _this10._scheduler.cancel(cancellationToken);
925
+ }
926
+ };
927
+ }).subscribe({
928
+ complete: function complete() {
929
+ _this10._complete(_id3);
930
+
931
+ decrementPendingCount();
932
+ },
933
+ error: function error(_error4) {
934
+ _this10._error(_error4);
935
+
936
+ decrementPendingCount();
937
+ },
938
+ start: function start(subscription) {
939
+ return _this10._start(_id3, subscription);
940
+ }
742
941
  });
743
942
  }
744
- }).subscribe({
745
- complete: function complete() {
746
- _this10._complete(_id3);
747
943
 
748
- decrementPendingCount();
749
- },
750
- error: function error(_error4) {
751
- _this10._error(_error4);
944
+ break;
752
945
 
753
- decrementPendingCount();
754
- },
755
- start: function start(subscription) {
756
- return _this10._start(_id3, subscription);
757
- }
758
- });
946
+ case 'ActorPayload':
947
+ this._processFollowupPayloadWithNormalizationNode(followupPayload, followupPayload.node);
948
+
949
+ break;
950
+
951
+ default:
952
+ followupPayload;
953
+ !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Unexpected followup kind `%s`.', followupPayload.kind) : invariant(false) : void 0;
759
954
  }
760
955
  };
761
956
 
762
- _proto._handleModuleImportPayload = function _handleModuleImportPayload(moduleImportPayload, operation) {
763
- var relayPayload = this._normalizeModuleImport(moduleImportPayload, operation);
957
+ _proto._processFollowupPayloadWithNormalizationNode = function _processFollowupPayloadWithNormalizationNode(followupPayload, normalizationNode) {
958
+ this._handleFollowupPayload(followupPayload, normalizationNode);
764
959
 
765
- this._publishQueue.commitPayload(this._operation, relayPayload);
960
+ this._maybeCompleteSubscriptionOperationTracking();
961
+ };
766
962
 
767
- var updatedOwners = this._publishQueue.run();
963
+ _proto._handleFollowupPayload = function _handleFollowupPayload(followupPayload, normalizationNode) {
964
+ var relayPayload = this._normalizeFollowupPayload(followupPayload, normalizationNode);
768
965
 
769
- this._updateOperationTracker(updatedOwners);
966
+ this._getPublishQueueAndSaveActor().commitPayload(this._operation, relayPayload);
770
967
 
771
968
  this._processPayloadFollowups([relayPayload]);
772
969
  }
@@ -816,7 +1013,7 @@ var Executor = /*#__PURE__*/function () {
816
1013
  parentID = placeholder.selector.dataID;
817
1014
  } else {
818
1015
  placeholder;
819
- !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'Unsupported incremental placeholder kind `%s`.', placeholder.kind) : invariant(false) : void 0;
1016
+ !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Unsupported incremental placeholder kind `%s`.', placeholder.kind) : invariant(false) : void 0;
820
1017
  }
821
1018
 
822
1019
  var parentRecord = relayPayload.source.get(parentID);
@@ -830,7 +1027,7 @@ var Executor = /*#__PURE__*/function () {
830
1027
  }); // If an incremental payload exists for some id that record should also
831
1028
  // exist.
832
1029
 
833
- !(parentRecord != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected record `%s` to exist.', parentID) : invariant(false) : void 0;
1030
+ !(parentRecord != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected record `%s` to exist.', parentID) : invariant(false) : void 0;
834
1031
  var nextParentRecord;
835
1032
  var nextParentPayloads;
836
1033
 
@@ -865,10 +1062,6 @@ var Executor = /*#__PURE__*/function () {
865
1062
  if (pendingResponses != null) {
866
1063
  var payloadFollowups = this._processIncrementalResponses(pendingResponses);
867
1064
 
868
- var updatedOwners = this._publishQueue.run();
869
-
870
- this._updateOperationTracker(updatedOwners);
871
-
872
1065
  this._processPayloadFollowups(payloadFollowups);
873
1066
  }
874
1067
  }
@@ -913,7 +1106,7 @@ var Executor = /*#__PURE__*/function () {
913
1106
  }
914
1107
 
915
1108
  var placeholder = resultForPath.placeholder;
916
- !(placeholder.kind === 'defer') ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected data for path `%s` for label `%s` ' + 'to be data for @defer, was `@%s`.', pathKey, label, placeholder.kind) : invariant(false) : void 0;
1109
+ !(placeholder.kind === 'defer') ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected data for path `%s` for label `%s` ' + 'to be data for @defer, was `@%s`.', pathKey, label, placeholder.kind) : invariant(false) : void 0;
917
1110
  relayPayloads.push(_this11._processDeferResponse(label, path, placeholder, response));
918
1111
  } else {
919
1112
  // @stream payload path values end in the field name and item index,
@@ -938,7 +1131,7 @@ var Executor = /*#__PURE__*/function () {
938
1131
  }
939
1132
 
940
1133
  var _placeholder = _resultForPath.placeholder;
941
- !(_placeholder.kind === 'stream') ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected data for path `%s` for label `%s` ' + 'to be data for @stream, was `@%s`.', _pathKey, label, _placeholder.kind) : invariant(false) : void 0;
1134
+ !(_placeholder.kind === 'stream') ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected data for path `%s` for label `%s` ' + 'to be data for @stream, was `@%s`.', _pathKey, label, _placeholder.kind) : invariant(false) : void 0;
942
1135
  relayPayloads.push(_this11._processStreamResponse(label, path, _placeholder, response));
943
1136
  }
944
1137
  });
@@ -946,23 +1139,28 @@ var Executor = /*#__PURE__*/function () {
946
1139
  };
947
1140
 
948
1141
  _proto._processDeferResponse = function _processDeferResponse(label, path, placeholder, response) {
1142
+ var _placeholder$actorIde;
1143
+
949
1144
  var parentID = placeholder.selector.dataID;
1145
+ var prevActorIdentifier = this._actorIdentifier;
1146
+ this._actorIdentifier = (_placeholder$actorIde = placeholder.actorIdentifier) !== null && _placeholder$actorIde !== void 0 ? _placeholder$actorIde : this._actorIdentifier;
950
1147
  var relayPayload = normalizeResponse(response, placeholder.selector, placeholder.typeName, {
1148
+ actorIdentifier: this._actorIdentifier,
951
1149
  getDataID: this._getDataID,
952
1150
  path: placeholder.path,
953
- reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer,
1151
+ reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer != null ? this._deserializeReactFlightPayloadWithLogging : null,
954
1152
  reactFlightServerErrorHandler: this._reactFlightServerErrorHandler,
955
1153
  treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
956
1154
  shouldProcessClientComponents: this._shouldProcessClientComponents
957
1155
  });
958
1156
 
959
- this._publishQueue.commitPayload(this._operation, relayPayload); // Load the version of the parent record from which this incremental data
1157
+ this._getPublishQueueAndSaveActor().commitPayload(this._operation, relayPayload); // Load the version of the parent record from which this incremental data
960
1158
  // was derived
961
1159
 
962
1160
 
963
1161
  var parentEntry = this._source.get(parentID);
964
1162
 
965
- !(parentEntry != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected the parent record `%s` for @defer ' + 'data to exist.', parentID) : invariant(false) : void 0;
1163
+ !(parentEntry != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected the parent record `%s` for @defer ' + 'data to exist.', parentID) : invariant(false) : void 0;
966
1164
  var fieldPayloads = parentEntry.fieldPayloads;
967
1165
 
968
1166
  if (fieldPayloads.length !== 0) {
@@ -972,14 +1170,15 @@ var Executor = /*#__PURE__*/function () {
972
1170
  errors: null,
973
1171
  fieldPayloads: fieldPayloads,
974
1172
  incrementalPlaceholders: null,
975
- moduleImportPayloads: null,
1173
+ followupPayloads: null,
976
1174
  source: RelayRecordSource.create(),
977
1175
  isFinal: ((_response$extensions2 = response.extensions) === null || _response$extensions2 === void 0 ? void 0 : _response$extensions2.is_final) === true
978
1176
  };
979
1177
 
980
- this._publishQueue.commitPayload(this._operation, handleFieldsRelayPayload);
1178
+ this._getPublishQueueAndSaveActor().commitPayload(this._operation, handleFieldsRelayPayload);
981
1179
  }
982
1180
 
1181
+ this._actorIdentifier = prevActorIdentifier;
983
1182
  return relayPayload;
984
1183
  }
985
1184
  /**
@@ -990,10 +1189,13 @@ var Executor = /*#__PURE__*/function () {
990
1189
  _proto._processStreamResponse = function _processStreamResponse(label, path, placeholder, response) {
991
1190
  var parentID = placeholder.parentID,
992
1191
  node = placeholder.node,
993
- variables = placeholder.variables; // Find the LinkedField where @stream was applied
1192
+ variables = placeholder.variables,
1193
+ actorIdentifier = placeholder.actorIdentifier;
1194
+ var prevActorIdentifier = this._actorIdentifier;
1195
+ this._actorIdentifier = actorIdentifier !== null && actorIdentifier !== void 0 ? actorIdentifier : this._actorIdentifier; // Find the LinkedField where @stream was applied
994
1196
 
995
1197
  var field = node.selections[0];
996
- !(field != null && field.kind === 'LinkedField' && field.plural === true) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected @stream to be used on a plural field.') : invariant(false) : void 0;
1198
+ !(field != null && field.kind === 'LinkedField' && field.plural === true) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected @stream to be used on a plural field.') : invariant(false) : void 0;
997
1199
 
998
1200
  var _this$_normalizeStrea = this._normalizeStreamItem(response, parentID, field, variables, path, placeholder.path),
999
1201
  fieldPayloads = _this$_normalizeStrea.fieldPayloads,
@@ -1006,7 +1208,7 @@ var Executor = /*#__PURE__*/function () {
1006
1208
  // modified.
1007
1209
 
1008
1210
 
1009
- this._publishQueue.commitPayload(this._operation, relayPayload, function (store) {
1211
+ this._getPublishQueueAndSaveActor().commitPayload(this._operation, relayPayload, function (store) {
1010
1212
  var currentParentRecord = store.get(parentID);
1011
1213
 
1012
1214
  if (currentParentRecord == null) {
@@ -1043,14 +1245,15 @@ var Executor = /*#__PURE__*/function () {
1043
1245
  errors: null,
1044
1246
  fieldPayloads: fieldPayloads,
1045
1247
  incrementalPlaceholders: null,
1046
- moduleImportPayloads: null,
1248
+ followupPayloads: null,
1047
1249
  source: RelayRecordSource.create(),
1048
1250
  isFinal: false
1049
1251
  };
1050
1252
 
1051
- this._publishQueue.commitPayload(this._operation, handleFieldsRelayPayload);
1253
+ this._getPublishQueueAndSaveActor().commitPayload(this._operation, handleFieldsRelayPayload);
1052
1254
  }
1053
1255
 
1256
+ this._actorIdentifier = prevActorIdentifier;
1054
1257
  return relayPayload;
1055
1258
  };
1056
1259
 
@@ -1058,34 +1261,34 @@ var Executor = /*#__PURE__*/function () {
1058
1261
  var _field$alias, _field$concreteType, _this$_getDataID;
1059
1262
 
1060
1263
  var data = response.data;
1061
- !(typeof data === 'object') ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected the GraphQL @stream payload `data` ' + 'value to be an object.') : invariant(false) : void 0;
1264
+ !(typeof data === 'object') ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected the GraphQL @stream payload `data` ' + 'value to be an object.') : invariant(false) : void 0;
1062
1265
  var responseKey = (_field$alias = field.alias) !== null && _field$alias !== void 0 ? _field$alias : field.name;
1063
1266
  var storageKey = getStorageKey(field, variables); // Load the version of the parent record from which this incremental data
1064
1267
  // was derived
1065
1268
 
1066
1269
  var parentEntry = this._source.get(parentID);
1067
1270
 
1068
- !(parentEntry != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected the parent record `%s` for @stream ' + 'data to exist.', parentID) : invariant(false) : void 0;
1271
+ !(parentEntry != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected the parent record `%s` for @stream ' + 'data to exist.', parentID) : invariant(false) : void 0;
1069
1272
  var parentRecord = parentEntry.record,
1070
1273
  fieldPayloads = parentEntry.fieldPayloads; // Load the field value (items) that were created by *this* query executor
1071
1274
  // in order to check if there has been any concurrent modifications by some
1072
1275
  // other operation.
1073
1276
 
1074
1277
  var prevIDs = RelayModernRecord.getLinkedRecordIDs(parentRecord, storageKey);
1075
- !(prevIDs != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected record `%s` to have fetched field ' + '`%s` with @stream.', parentID, field.name) : invariant(false) : void 0; // Determine the index in the field of the new item
1278
+ !(prevIDs != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected record `%s` to have fetched field ' + '`%s` with @stream.', parentID, field.name) : invariant(false) : void 0; // Determine the index in the field of the new item
1076
1279
 
1077
1280
  var finalPathEntry = path[path.length - 1];
1078
1281
  var itemIndex = parseInt(finalPathEntry, 10);
1079
- !(itemIndex === finalPathEntry && itemIndex >= 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected path for @stream to end in a ' + 'positive integer index, got `%s`', finalPathEntry) : invariant(false) : void 0;
1282
+ !(itemIndex === finalPathEntry && itemIndex >= 0) ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected path for @stream to end in a ' + 'positive integer index, got `%s`', finalPathEntry) : invariant(false) : void 0;
1080
1283
  var typeName = (_field$concreteType = field.concreteType) !== null && _field$concreteType !== void 0 ? _field$concreteType : data[TYPENAME_KEY];
1081
- !(typeof typeName === 'string') ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected @stream field `%s` to have a ' + '__typename.', field.name) : invariant(false) : void 0; // Determine the __id of the new item: this must equal the value that would
1284
+ !(typeof typeName === 'string') ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected @stream field `%s` to have a ' + '__typename.', field.name) : invariant(false) : void 0; // Determine the __id of the new item: this must equal the value that would
1082
1285
  // be assigned had the item not been streamed
1083
1286
 
1084
1287
  var itemID = // https://github.com/prettier/prettier/issues/6403
1085
1288
  // prettier-ignore
1086
1289
  ((_this$_getDataID = this._getDataID(data, typeName)) !== null && _this$_getDataID !== void 0 ? _this$_getDataID : prevIDs && prevIDs[itemIndex]) || // Reuse previously generated client IDs
1087
1290
  generateClientID(parentID, storageKey, itemIndex);
1088
- !(typeof itemID === 'string') ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected id of elements of field `%s` to ' + 'be strings.', storageKey) : invariant(false) : void 0; // Build a selector to normalize the item data with
1291
+ !(typeof itemID === 'string') ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected id of elements of field `%s` to ' + 'be strings.', storageKey) : invariant(false) : void 0; // Build a selector to normalize the item data with
1089
1292
 
1090
1293
  var selector = createNormalizationSelector(field, itemID, variables); // Update the cached version of the parent record to reflect the new item:
1091
1294
  // this is used when subsequent stream payloads arrive to see if there
@@ -1102,9 +1305,10 @@ var Executor = /*#__PURE__*/function () {
1102
1305
  });
1103
1306
 
1104
1307
  var relayPayload = normalizeResponse(response, selector, typeName, {
1308
+ actorIdentifier: this._actorIdentifier,
1105
1309
  getDataID: this._getDataID,
1106
1310
  path: [].concat((0, _toConsumableArray2["default"])(normalizationPath), [responseKey, String(itemIndex)]),
1107
- reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer,
1311
+ reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer != null ? this._deserializeReactFlightPayloadWithLogging : null,
1108
1312
  reactFlightServerErrorHandler: this._reactFlightServerErrorHandler,
1109
1313
  treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
1110
1314
  shouldProcessClientComponents: this._shouldProcessClientComponents
@@ -1119,18 +1323,132 @@ var Executor = /*#__PURE__*/function () {
1119
1323
  };
1120
1324
  };
1121
1325
 
1326
+ _proto._scheduleAsyncStoreUpdate = function _scheduleAsyncStoreUpdate(scheduleFn, completeFn) {
1327
+ var _this12 = this;
1328
+
1329
+ this._completeFns.push(completeFn);
1330
+
1331
+ if (this._asyncStoreUpdateDisposable != null) {
1332
+ return;
1333
+ }
1334
+
1335
+ this._asyncStoreUpdateDisposable = scheduleFn(function () {
1336
+ _this12._asyncStoreUpdateDisposable = null;
1337
+
1338
+ var updatedOwners = _this12._runPublishQueue();
1339
+
1340
+ _this12._updateOperationTracker(updatedOwners);
1341
+
1342
+ var _iterator2 = (0, _createForOfIteratorHelper2["default"])(_this12._completeFns),
1343
+ _step2;
1344
+
1345
+ try {
1346
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1347
+ var complete = _step2.value;
1348
+ complete();
1349
+ }
1350
+ } catch (err) {
1351
+ _iterator2.e(err);
1352
+ } finally {
1353
+ _iterator2.f();
1354
+ }
1355
+
1356
+ _this12._completeFns = [];
1357
+ });
1358
+ };
1359
+
1122
1360
  _proto._updateOperationTracker = function _updateOperationTracker(updatedOwners) {
1123
- if (this._operationTracker != null && updatedOwners != null && updatedOwners.length > 0) {
1361
+ if (updatedOwners != null && updatedOwners.length > 0) {
1124
1362
  this._operationTracker.update(this._operation.request, new Set(updatedOwners));
1125
1363
  }
1126
1364
  };
1127
1365
 
1128
1366
  _proto._completeOperationTracker = function _completeOperationTracker() {
1129
- if (this._operationTracker != null) {
1130
- this._operationTracker.complete(this._operation.request);
1367
+ this._operationTracker.complete(this._operation.request);
1368
+ };
1369
+
1370
+ _proto._getPublishQueueAndSaveActor = function _getPublishQueueAndSaveActor() {
1371
+ this._seenActors.add(this._actorIdentifier);
1372
+
1373
+ return this._getPublishQueue(this._actorIdentifier);
1374
+ };
1375
+
1376
+ _proto._getActorsToVisit = function _getActorsToVisit() {
1377
+ if (this._seenActors.size === 0) {
1378
+ return new Set([this._actorIdentifier]);
1379
+ } else {
1380
+ return this._seenActors;
1131
1381
  }
1132
1382
  };
1133
1383
 
1384
+ _proto._runPublishQueue = function _runPublishQueue(operation) {
1385
+ var updatedOwners = new Set();
1386
+
1387
+ var _iterator3 = (0, _createForOfIteratorHelper2["default"])(this._getActorsToVisit()),
1388
+ _step3;
1389
+
1390
+ try {
1391
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1392
+ var _actorIdentifier = _step3.value;
1393
+
1394
+ var owners = this._getPublishQueue(_actorIdentifier).run(operation);
1395
+
1396
+ owners.forEach(function (owner) {
1397
+ return updatedOwners.add(owner);
1398
+ });
1399
+ }
1400
+ } catch (err) {
1401
+ _iterator3.e(err);
1402
+ } finally {
1403
+ _iterator3.f();
1404
+ }
1405
+
1406
+ return Array.from(updatedOwners);
1407
+ };
1408
+
1409
+ _proto._retainData = function _retainData() {
1410
+ var _iterator4 = (0, _createForOfIteratorHelper2["default"])(this._getActorsToVisit()),
1411
+ _step4;
1412
+
1413
+ try {
1414
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
1415
+ var _actorIdentifier2 = _step4.value;
1416
+
1417
+ if (!this._retainDisposables.has(_actorIdentifier2)) {
1418
+ this._retainDisposables.set(_actorIdentifier2, this._getStore(_actorIdentifier2).retain(this._operation));
1419
+ }
1420
+ }
1421
+ } catch (err) {
1422
+ _iterator4.e(err);
1423
+ } finally {
1424
+ _iterator4.f();
1425
+ }
1426
+ };
1427
+
1428
+ _proto._disposeRetainedData = function _disposeRetainedData() {
1429
+ var _iterator5 = (0, _createForOfIteratorHelper2["default"])(this._retainDisposables.values()),
1430
+ _step5;
1431
+
1432
+ try {
1433
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
1434
+ var disposable = _step5.value;
1435
+ disposable.dispose();
1436
+ }
1437
+ } catch (err) {
1438
+ _iterator5.e(err);
1439
+ } finally {
1440
+ _iterator5.f();
1441
+ }
1442
+
1443
+ this._retainDisposables.clear();
1444
+ };
1445
+
1446
+ _proto._expectOperationLoader = function _expectOperationLoader() {
1447
+ var operationLoader = this._operationLoader;
1448
+ !operationLoader ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: Expected an operationLoader to be ' + 'configured when using `@match`.') : invariant(false) : void 0;
1449
+ return operationLoader;
1450
+ };
1451
+
1134
1452
  return Executor;
1135
1453
  }();
1136
1454
 
@@ -1143,7 +1461,7 @@ function partitionGraphQLResponses(responses) {
1143
1461
  path = response.path;
1144
1462
 
1145
1463
  if (label == null || path == null) {
1146
- !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernQueryExecutor: invalid incremental payload, expected ' + '`path` and `label` to either both be null/undefined, or ' + '`path` to be an `Array<string | number>` and `label` to be a ' + '`string`.') : invariant(false) : void 0;
1464
+ !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: invalid incremental payload, expected ' + '`path` and `label` to either both be null/undefined, or ' + '`path` to be an `Array<string | number>` and `label` to be a ' + '`string`.') : invariant(false) : void 0;
1147
1465
  }
1148
1466
 
1149
1467
  incrementalResponses.push({
@@ -1183,7 +1501,7 @@ function validateOptimisticResponsePayload(payload) {
1183
1501
  var incrementalPlaceholders = payload.incrementalPlaceholders;
1184
1502
 
1185
1503
  if (incrementalPlaceholders != null && incrementalPlaceholders.length !== 0) {
1186
- !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernQueryExecutor: optimistic responses cannot be returned ' + 'for operations that use incremental data delivery (@defer, ' + '@stream, and @stream_connection).') : invariant(false) : void 0;
1504
+ !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'OperationExecutor: optimistic responses cannot be returned ' + 'for operations that use incremental data delivery (@defer, ' + '@stream, and @stream_connection).') : invariant(false) : void 0;
1187
1505
  }
1188
1506
  }
1189
1507