relay-runtime 4.0.0 → 5.0.0

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 (60) hide show
  1. package/index.js +1 -1
  2. package/lib/ClientID.js +1 -1
  3. package/lib/ConvertToExecuteFunction.js +1 -1
  4. package/lib/DataChecker.js +10 -9
  5. package/lib/NormalizationNode.js +1 -1
  6. package/lib/ReaderNode.js +1 -1
  7. package/lib/RelayCombinedEnvironmentTypes.js +1 -1
  8. package/lib/RelayConcreteNode.js +1 -1
  9. package/lib/RelayConnectionHandler.js +1 -1
  10. package/lib/RelayConnectionInterface.js +1 -1
  11. package/lib/RelayDefaultHandleKey.js +1 -1
  12. package/lib/RelayDefaultHandlerProvider.js +1 -6
  13. package/lib/RelayDefaultMissingFieldHandlers.js +26 -0
  14. package/lib/RelayFeatureFlags.js +3 -5
  15. package/lib/RelayModernEnvironment.js +30 -20
  16. package/lib/RelayModernFragmentOwner.js +1 -1
  17. package/lib/RelayModernFragmentSpecResolver.js +36 -49
  18. package/lib/RelayModernOperationDescriptor.js +1 -1
  19. package/lib/RelayModernQueryExecutor.js +200 -92
  20. package/lib/RelayModernSelector.js +36 -16
  21. package/lib/RelayModernStore.js +14 -8
  22. package/lib/RelayNetwork.js +1 -1
  23. package/lib/RelayNetworkLogger.js +1 -1
  24. package/lib/RelayNetworkTypes.js +1 -1
  25. package/lib/RelayObservable.js +69 -40
  26. package/lib/RelayOperationTracker.js +26 -39
  27. package/lib/RelayPublishQueue.js +24 -19
  28. package/lib/RelayQueryResponseCache.js +1 -1
  29. package/lib/RelayReader.js +23 -5
  30. package/lib/RelayRecordProxy.js +7 -3
  31. package/lib/RelayRecordSourceMutator.js +1 -1
  32. package/lib/RelayRecordSourceProxy.js +5 -2
  33. package/lib/RelayRecordSourceSelectorProxy.js +1 -1
  34. package/lib/RelayRecordState.js +1 -1
  35. package/lib/RelayReferenceMarker.js +4 -3
  36. package/lib/RelayReplaySubject.js +1 -1
  37. package/lib/RelayResponseNormalizer.js +57 -19
  38. package/lib/RelayRuntimeTypes.js +1 -1
  39. package/lib/RelayStoreUtils.js +39 -9
  40. package/lib/RelayViewerHandler.js +2 -49
  41. package/lib/StoreInspector.js +1 -1
  42. package/lib/cloneRelayHandleSourceField.js +1 -1
  43. package/lib/commitLocalUpdate.js +1 -1
  44. package/lib/createRelayContext.js +1 -1
  45. package/lib/deepFreeze.js +1 -1
  46. package/lib/defaultGetDataID.js +24 -0
  47. package/lib/fetchQueryInternal.js +1 -1
  48. package/lib/fetchRelayModernQuery.js +1 -1
  49. package/lib/getFragmentIdentifier.js +1 -1
  50. package/lib/getFragmentSpecIdentifier.js +1 -1
  51. package/lib/getRequestParametersIdentifier.js +1 -1
  52. package/lib/hasOverlappingIDs.js +1 -1
  53. package/lib/index.js +5 -0
  54. package/lib/isPromise.js +1 -1
  55. package/lib/isScalarAndEqual.js +1 -1
  56. package/lib/normalizeRelayPayload.js +2 -5
  57. package/lib/recycleNodesInto.js +7 -1
  58. package/package.json +2 -2
  59. package/relay-runtime.js +2 -2
  60. package/relay-runtime.min.js +2 -2
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v4.0.0
2
+ * Relay v5.0.0
3
3
  *
4
4
  * Copyright (c) 2013-present, Facebook, Inc.
5
5
  *
package/lib/ClientID.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict-local
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict-local
7
+ *
8
8
  * @format
9
9
  * @emails oncall+relay
10
10
  */
@@ -37,9 +37,9 @@ var CONDITION = RelayConcreteNode.CONDITION,
37
37
  SCALAR_FIELD = RelayConcreteNode.SCALAR_FIELD,
38
38
  SCALAR_HANDLE = RelayConcreteNode.SCALAR_HANDLE,
39
39
  STREAM = RelayConcreteNode.STREAM;
40
- var getStorageKey = RelayStoreUtils.getStorageKey,
41
- getArgumentValues = RelayStoreUtils.getArgumentValues,
42
- MODULE_OPERATION_KEY = RelayStoreUtils.MODULE_OPERATION_KEY;
40
+ var getModuleOperationKey = RelayStoreUtils.getModuleOperationKey,
41
+ getStorageKey = RelayStoreUtils.getStorageKey,
42
+ getArgumentValues = RelayStoreUtils.getArgumentValues;
43
43
  /**
44
44
  * Synchronously check whether the records required to fulfill the given
45
45
  * `selector` are present in `source`.
@@ -51,11 +51,11 @@ var getStorageKey = RelayStoreUtils.getStorageKey,
51
51
  * If all records are present, returns `true`, otherwise `false`.
52
52
  */
53
53
 
54
- function check(source, target, selector, handlers, operationLoader) {
54
+ function check(source, target, selector, handlers, operationLoader, getDataID) {
55
55
  var dataID = selector.dataID,
56
56
  node = selector.node,
57
57
  variables = selector.variables;
58
- var checker = new DataChecker(source, target, variables, handlers, operationLoader);
58
+ var checker = new DataChecker(source, target, variables, handlers, operationLoader, getDataID);
59
59
  return checker.check(node, dataID);
60
60
  }
61
61
  /**
@@ -66,7 +66,7 @@ function check(source, target, selector, handlers, operationLoader) {
66
66
  var DataChecker =
67
67
  /*#__PURE__*/
68
68
  function () {
69
- function DataChecker(source, target, variables, handlers, operationLoader) {
69
+ function DataChecker(source, target, variables, handlers, operationLoader, getDataID) {
70
70
  var _operationLoader;
71
71
 
72
72
  this._operationLoader = (_operationLoader = operationLoader) !== null && _operationLoader !== void 0 ? _operationLoader : null;
@@ -75,7 +75,7 @@ function () {
75
75
  this._recordWasMissing = false;
76
76
  this._source = source;
77
77
  this._variables = variables;
78
- this._recordSourceProxy = new RelayRecordSourceProxy(this._mutator);
78
+ this._recordSourceProxy = new RelayRecordSourceProxy(this._mutator, getDataID);
79
79
  }
80
80
 
81
81
  var _proto = DataChecker.prototype;
@@ -326,8 +326,9 @@ function () {
326
326
  _proto._checkModuleImport = function _checkModuleImport(moduleImport, dataID) {
327
327
  var operationLoader = this._operationLoader;
328
328
  !(operationLoader !== null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'DataChecker: Expected an operationLoader to be configured when using `@module`.') : invariant(false) : void 0;
329
+ var operationKey = getModuleOperationKey(moduleImport.documentName);
329
330
 
330
- var operationReference = this._mutator.getValue(dataID, MODULE_OPERATION_KEY);
331
+ var operationReference = this._mutator.getValue(dataID, operationKey);
331
332
 
332
333
  if (operationReference == null) {
333
334
  if (operationReference === undefined) {
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
package/lib/ReaderNode.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict-local
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict-local
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict-local
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -494,7 +494,7 @@ function mergeEdges(sourceEdges, targetEdges, nodeIDs) {
494
494
  }
495
495
 
496
496
  var node = edge.getLinkedRecord(NODE);
497
- var nodeID = node && node.getValue('id');
497
+ var nodeID = node && node.getDataID();
498
498
 
499
499
  if (nodeID) {
500
500
  if (nodeIDs.has(nodeID)) {
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict-local
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -4,24 +4,19 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict-local
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
11
11
 
12
12
  var RelayConnectionHandler = require("./RelayConnectionHandler");
13
13
 
14
- var RelayViewerHandler = require("./RelayViewerHandler");
15
-
16
14
  var invariant = require("fbjs/lib/invariant");
17
15
 
18
16
  function RelayDefaultHandlerProvider(handle) {
19
17
  switch (handle) {
20
18
  case 'connection':
21
19
  return RelayConnectionHandler;
22
-
23
- case 'viewer':
24
- return RelayViewerHandler;
25
20
  }
26
21
 
27
22
  !false ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayDefaultHandlerProvider: No handler provided for `%s`.', handle) : invariant(false) : void 0;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ *
8
+ * @format
9
+ */
10
+ 'use strict';
11
+
12
+ var _require = require("./RelayStoreUtils"),
13
+ ROOT_TYPE = _require.ROOT_TYPE;
14
+
15
+ var _require2 = require("./RelayViewerHandler"),
16
+ VIEWER_ID = _require2.VIEWER_ID;
17
+
18
+ var missingViewerFieldHandler = {
19
+ kind: 'linked',
20
+ handle: function handle(field, record, argValues) {
21
+ if (record != null && record.__typename === ROOT_TYPE && field.name === 'viewer') {
22
+ return VIEWER_ID;
23
+ }
24
+ }
25
+ };
26
+ module.exports = [missingViewerFieldHandler];
@@ -4,15 +4,13 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
11
11
 
12
12
  var RelayFeatureFlags = {
13
- MERGE_FETCH_AND_FRAGMENT_VARS: false,
14
- PREFER_FRAGMENT_OWNER_OVER_CONTEXT: false,
15
- ENABLE_INCREMENTAL_DELIVERY: false,
16
- INCREMENTAL_DELIVERY_VARIABLE_NAME: 'RELAY_INCREMENTAL_DELIVERY'
13
+ // T45504512: new connection model
14
+ ENABLE_VARIABLE_CONNECTION_KEY: false
17
15
  };
18
16
  module.exports = RelayFeatureFlags;
@@ -20,6 +20,8 @@ var RelayCore = require("./RelayCore");
20
20
 
21
21
  var RelayDefaultHandlerProvider = require("./RelayDefaultHandlerProvider");
22
22
 
23
+ var RelayDefaultMissingFieldHandlers = require("./RelayDefaultMissingFieldHandlers");
24
+
23
25
  var RelayInMemoryRecordSource = require("./RelayInMemoryRecordSource");
24
26
 
25
27
  var RelayModernQueryExecutor = require("./RelayModernQueryExecutor");
@@ -28,6 +30,8 @@ var RelayObservable = require("./RelayObservable");
28
30
 
29
31
  var RelayPublishQueue = require("./RelayPublishQueue");
30
32
 
33
+ var defaultGetDataID = require("./defaultGetDataID");
34
+
31
35
  var invariant = require("fbjs/lib/invariant");
32
36
 
33
37
  var normalizeRelayPayload = require("./normalizeRelayPayload");
@@ -40,7 +44,7 @@ function () {
40
44
  function RelayModernEnvironment(config) {
41
45
  var _this = this;
42
46
 
43
- var _config$publishQueue, _config$scheduler;
47
+ var _config$UNSTABLE_DO_N, _config$publishQueue, _config$scheduler, _config$missingFieldH;
44
48
 
45
49
  this.configName = config.configName;
46
50
  var handlerProvider = config.handlerProvider ? config.handlerProvider : RelayDefaultHandlerProvider;
@@ -54,7 +58,8 @@ function () {
54
58
 
55
59
  this._operationLoader = operationLoader;
56
60
  this._network = config.network;
57
- this._publishQueue = (_config$publishQueue = config.publishQueue) !== null && _config$publishQueue !== void 0 ? _config$publishQueue : new RelayPublishQueue(config.store, handlerProvider);
61
+ this._getDataID = (_config$UNSTABLE_DO_N = config.UNSTABLE_DO_NOT_USE_getDataID) !== null && _config$UNSTABLE_DO_N !== void 0 ? _config$UNSTABLE_DO_N : defaultGetDataID;
62
+ this._publishQueue = (_config$publishQueue = config.publishQueue) !== null && _config$publishQueue !== void 0 ? _config$publishQueue : new RelayPublishQueue(config.store, handlerProvider, this._getDataID);
58
63
  this._scheduler = (_config$scheduler = config.scheduler) !== null && _config$scheduler !== void 0 ? _config$scheduler : null;
59
64
  this._store = config.store;
60
65
  this.unstable_internal = (0, _objectSpread2["default"])({}, RelayCore, {
@@ -86,9 +91,7 @@ function () {
86
91
  devToolsHook.registerEnvironment(this);
87
92
  }
88
93
 
89
- if (config.missingFieldHandlers != null) {
90
- this._missingFieldHandlers = config.missingFieldHandlers;
91
- }
94
+ this._missingFieldHandlers = (_config$missingFieldH = config.missingFieldHandlers) !== null && _config$missingFieldH !== void 0 ? _config$missingFieldH : RelayDefaultMissingFieldHandlers;
92
95
 
93
96
  if (config.operationTracker != null) {
94
97
  this._operationTracker = config.operationTracker;
@@ -158,7 +161,11 @@ function () {
158
161
 
159
162
  _proto.commitPayload = function commitPayload(operationDescriptor, payload) {
160
163
  // Do not handle stripped nulls when committing a payload
161
- var relayPayload = normalizeRelayPayload(operationDescriptor.root, payload);
164
+ var relayPayload = normalizeRelayPayload(operationDescriptor.root, payload, null
165
+ /* errors */
166
+ , {
167
+ getDataID: this._getDataID
168
+ });
162
169
 
163
170
  this._publishQueue.commitPayload(operationDescriptor, relayPayload);
164
171
 
@@ -185,7 +192,7 @@ function () {
185
192
 
186
193
  _proto._checkSelectorAndHandleMissingFields = function _checkSelectorAndHandleMissingFields(selector, handlers) {
187
194
  var target = new RelayInMemoryRecordSource();
188
- var result = DataChecker.check(this._store.getSource(), target, selector, handlers, this._operationLoader);
195
+ var result = DataChecker.check(this._store.getSource(), target, selector, handlers, this._operationLoader, this._getDataID);
189
196
 
190
197
  if (target.size() > 0) {
191
198
  this._publishQueue.commitSource(target);
@@ -194,7 +201,7 @@ function () {
194
201
  }
195
202
 
196
203
  return result;
197
- };
204
+ }
198
205
  /**
199
206
  * Returns an Observable of GraphQLResponse resulting from executing the
200
207
  * provided Query or Subscription operation, each result of which is then
@@ -203,7 +210,7 @@ function () {
203
210
  * Note: Observables are lazy, so calling this method will do nothing until
204
211
  * the result is subscribed to: environment.execute({...}).subscribe({...}).
205
212
  */
206
-
213
+ ;
207
214
 
208
215
  _proto.execute = function execute(_ref2) {
209
216
  var _this3 = this;
@@ -223,13 +230,14 @@ function () {
223
230
  sink: sink,
224
231
  source: source,
225
232
  updater: updater,
226
- operationTracker: _this3._operationTracker
233
+ operationTracker: _this3._operationTracker,
234
+ getDataID: _this3._getDataID
227
235
  });
228
236
  return function () {
229
237
  return executor.cancel();
230
238
  };
231
239
  });
232
- };
240
+ }
233
241
  /**
234
242
  * Returns an Observable of GraphQLResponse resulting from executing the
235
243
  * provided Mutation operation, the result of which is then normalized and
@@ -240,7 +248,7 @@ function () {
240
248
  * the result is subscribed to:
241
249
  * environment.executeMutation({...}).subscribe({...}).
242
250
  */
243
-
251
+ ;
244
252
 
245
253
  _proto.executeMutation = function executeMutation(_ref3) {
246
254
  var _this4 = this;
@@ -276,13 +284,14 @@ function () {
276
284
  sink: sink,
277
285
  source: source,
278
286
  updater: updater,
279
- operationTracker: _this4._operationTracker
287
+ operationTracker: _this4._operationTracker,
288
+ getDataID: _this4._getDataID
280
289
  });
281
290
  return function () {
282
291
  return executor.cancel();
283
292
  };
284
293
  });
285
- };
294
+ }
286
295
  /**
287
296
  * Returns an Observable of GraphQLResponse resulting from executing the
288
297
  * provided Query or Subscription operation responses, the result of which is
@@ -292,7 +301,7 @@ function () {
292
301
  * the result is subscribed to:
293
302
  * environment.executeWithSource({...}).subscribe({...}).
294
303
  */
295
-
304
+ ;
296
305
 
297
306
  _proto.executeWithSource = function executeWithSource(_ref4) {
298
307
  var _this5 = this;
@@ -307,17 +316,18 @@ function () {
307
316
  publishQueue: _this5._publishQueue,
308
317
  scheduler: _this5._scheduler,
309
318
  sink: sink,
310
- source: source
319
+ source: source,
320
+ getDataID: _this5._getDataID
311
321
  });
312
322
  return function () {
313
323
  return executor.cancel();
314
324
  };
315
325
  });
316
- };
326
+ }
317
327
  /**
318
328
  * @deprecated Use Environment.execute().subscribe()
319
329
  */
320
-
330
+ ;
321
331
 
322
332
  _proto.sendQuery = function sendQuery(_ref5) {
323
333
  var cacheConfig = _ref5.cacheConfig,
@@ -334,11 +344,11 @@ function () {
334
344
  onError: onError,
335
345
  onCompleted: onCompleted
336
346
  });
337
- };
347
+ }
338
348
  /**
339
349
  * @deprecated Use Environment.executeMutation().subscribe()
340
350
  */
341
-
351
+ ;
342
352
 
343
353
  _proto.sendMutation = function sendMutation(_ref6) {
344
354
  var onCompleted = _ref6.onCompleted,
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict-local
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -15,8 +15,6 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
15
15
 
16
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
17
 
18
- var RelayFeatureFlags = require("./RelayFeatureFlags");
19
-
20
18
  var areEqual = require("fbjs/lib/areEqual");
21
19
 
22
20
  var invariant = require("fbjs/lib/invariant");
@@ -129,9 +127,9 @@ function () {
129
127
  };
130
128
 
131
129
  _proto.setProps = function setProps(props) {
132
- var ownedSelectors = RelayFeatureFlags.PREFER_FRAGMENT_OWNER_OVER_CONTEXT ? getSelectorsFromObject( // NOTE: We pass empty operationVariables because we want to prefer
130
+ var ownedSelectors = getSelectorsFromObject( // NOTE: We pass empty operationVariables because we want to prefer
133
131
  // the variables from the fragment owner
134
- {}, this._fragments, props, getFragmentOwners(this._fragments, props)) : getSelectorsFromObject(this._context.variables, this._fragments, props);
132
+ {}, this._fragments, props, getFragmentOwners(this._fragments, props));
135
133
 
136
134
  for (var _key3 in ownedSelectors) {
137
135
  if (ownedSelectors.hasOwnProperty(_key3)) {
@@ -239,54 +237,43 @@ function () {
239
237
  };
240
238
 
241
239
  _proto2.setVariables = function setVariables(variables, request) {
242
- var ownedSelector;
243
-
244
- if (RelayFeatureFlags.PREFER_FRAGMENT_OWNER_OVER_CONTEXT) {
245
- if (areEqual(variables, this._ownedSelector.selector.variables)) {
246
- // If we're not actually setting new variables, we don't actually want
247
- // to create a new fragment owner, since areEqualSelectors relies on
248
- // owner identity when fragment ownership is enabled.
249
- // In fact, we don't even need to try to attempt to set a new selector.
250
- // When fragment ownership is not enabled, setSelector will also bail
251
- // out since the selector doesn't really change, so we're doing it here
252
- // earlier.
253
- return;
254
- }
240
+ if (areEqual(variables, this._ownedSelector.selector.variables)) {
241
+ // If we're not actually setting new variables, we don't actually want
242
+ // to create a new fragment owner, since areEqualSelectors relies on
243
+ // owner identity when fragment ownership is enabled.
244
+ // In fact, we don't even need to try to attempt to set a new selector.
245
+ // When fragment ownership is not enabled, setSelector will also bail
246
+ // out since the selector doesn't really change, so we're doing it here
247
+ // earlier.
248
+ return;
249
+ }
255
250
 
256
- ownedSelector = {
257
- owner: request ? // NOTE: We manually create the operation descriptor here instead of
258
- // calling createOperationDescriptor() because we want to set a
259
- // descriptor with *unaltered* variables as the fragment owner.
260
- // This is a hack that allows us to preserve exisiting (broken)
261
- // behavior of RelayModern containers while using fragment ownership
262
- // to propagate variables instead of Context.
263
- // For more details, see the summary of D13999308
264
- {
265
- fragment: {
266
- dataID: ROOT_ID,
267
- node: request.fragment,
268
- variables: variables
269
- },
270
- node: request,
271
- root: {
272
- dataID: ROOT_ID,
273
- node: request.operation,
274
- variables: variables
275
- },
251
+ var ownedSelector = {
252
+ owner: request ? // NOTE: We manually create the operation descriptor here instead of
253
+ // calling createOperationDescriptor() because we want to set a
254
+ // descriptor with *unaltered* variables as the fragment owner.
255
+ // This is a hack that allows us to preserve exisiting (broken)
256
+ // behavior of RelayModern containers while using fragment ownership
257
+ // to propagate variables instead of Context.
258
+ // For more details, see the summary of D13999308
259
+ {
260
+ fragment: {
261
+ dataID: ROOT_ID,
262
+ node: request.fragment,
276
263
  variables: variables
277
- } : null,
278
- selector: (0, _objectSpread2["default"])({}, this._ownedSelector.selector, {
264
+ },
265
+ node: request,
266
+ root: {
267
+ dataID: ROOT_ID,
268
+ node: request.operation,
279
269
  variables: variables
280
- })
281
- };
282
- } else {
283
- ownedSelector = (0, _objectSpread2["default"])({}, this._ownedSelector, {
284
- selector: (0, _objectSpread2["default"])({}, this._ownedSelector.selector, {
285
- variables: variables
286
- })
287
- });
288
- }
289
-
270
+ },
271
+ variables: variables
272
+ } : null,
273
+ selector: (0, _objectSpread2["default"])({}, this._ownedSelector.selector, {
274
+ variables: variables
275
+ })
276
+ };
290
277
  this.setSelector(ownedSelector);
291
278
  };
292
279
 
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * strict-local
7
+ *
8
8
  * @format
9
9
  */
10
10
  'use strict';