relay-runtime 11.0.0 → 13.0.0-rc.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.
- package/handlers/RelayDefaultHandlerProvider.js.flow +2 -2
- package/handlers/connection/ConnectionHandler.js.flow +8 -10
- package/handlers/connection/MutationHandlers.js.flow +31 -7
- package/index.js +1 -1
- package/index.js.flow +60 -36
- package/lib/handlers/RelayDefaultHandlerProvider.js +1 -1
- package/lib/handlers/connection/ConnectionHandler.js +8 -8
- package/lib/handlers/connection/MutationHandlers.js +61 -5
- package/lib/index.js +58 -43
- package/lib/multi-actor-environment/ActorIdentifier.js +33 -0
- package/lib/multi-actor-environment/ActorSpecificEnvironment.js +152 -0
- package/lib/multi-actor-environment/ActorUtils.js +27 -0
- package/lib/multi-actor-environment/MultiActorEnvironment.js +419 -0
- package/lib/multi-actor-environment/MultiActorEnvironmentTypes.js +11 -0
- package/lib/multi-actor-environment/index.js +21 -0
- package/lib/mutations/RelayDeclarativeMutationConfig.js +4 -1
- package/lib/mutations/RelayRecordProxy.js +3 -2
- package/lib/mutations/RelayRecordSourceMutator.js +3 -2
- package/lib/mutations/RelayRecordSourceProxy.js +12 -4
- package/lib/mutations/RelayRecordSourceSelectorProxy.js +18 -5
- package/lib/mutations/applyOptimisticMutation.js +6 -6
- package/lib/mutations/commitMutation.js +14 -10
- package/lib/mutations/readUpdatableQuery_EXPERIMENTAL.js +238 -0
- package/lib/mutations/validateMutation.js +12 -5
- package/lib/network/ConvertToExecuteFunction.js +2 -1
- package/lib/network/RelayNetwork.js +3 -2
- package/lib/network/RelayQueryResponseCache.js +21 -4
- package/lib/network/wrapNetworkWithLogObserver.js +79 -0
- package/lib/query/GraphQLTag.js +3 -2
- package/lib/query/fetchQuery.js +6 -5
- package/lib/query/fetchQueryInternal.js +1 -1
- package/lib/query/fetchQuery_DEPRECATED.js +2 -1
- package/lib/store/ClientID.js +7 -1
- package/lib/store/DataChecker.js +141 -60
- package/lib/store/{RelayModernQueryExecutor.js → OperationExecutor.js} +532 -195
- package/lib/store/RelayConcreteVariables.js +24 -4
- package/lib/store/RelayModernEnvironment.js +175 -234
- package/lib/store/RelayModernFragmentSpecResolver.js +52 -26
- package/lib/store/RelayModernOperationDescriptor.js +2 -1
- package/lib/store/RelayModernRecord.js +47 -12
- package/lib/store/RelayModernSelector.js +14 -8
- package/lib/store/RelayModernStore.js +58 -29
- package/lib/store/RelayOperationTracker.js +34 -24
- package/lib/store/RelayPublishQueue.js +41 -13
- package/lib/store/RelayReader.js +287 -46
- package/lib/store/RelayRecordSource.js +87 -3
- package/lib/store/RelayReferenceMarker.js +55 -31
- package/lib/store/RelayResponseNormalizer.js +250 -108
- package/lib/store/RelayStoreReactFlightUtils.js +8 -12
- package/lib/store/RelayStoreSubscriptions.js +14 -9
- package/lib/store/RelayStoreUtils.js +11 -5
- package/lib/store/ResolverCache.js +213 -0
- package/lib/store/ResolverFragments.js +61 -0
- package/lib/store/cloneRelayHandleSourceField.js +5 -4
- package/lib/store/cloneRelayScalarHandleSourceField.js +5 -4
- package/lib/store/createRelayContext.js +4 -2
- package/lib/store/defaultGetDataID.js +3 -1
- package/lib/store/readInlineData.js +6 -2
- package/lib/subscription/requestSubscription.js +35 -9
- package/lib/util/RelayConcreteNode.js +4 -0
- package/lib/util/RelayFeatureFlags.js +11 -4
- package/lib/util/RelayProfiler.js +17 -187
- package/lib/util/RelayReplaySubject.js +22 -7
- package/lib/util/RelayRuntimeTypes.js +0 -6
- package/lib/util/StringInterner.js +71 -0
- package/lib/util/deepFreeze.js +1 -0
- package/lib/util/getFragmentIdentifier.js +15 -7
- package/lib/util/getOperation.js +2 -1
- package/lib/util/getPaginationMetadata.js +41 -0
- package/lib/util/getPaginationVariables.js +66 -0
- package/lib/util/getPendingOperationsForFragment.js +55 -0
- package/lib/util/getRefetchMetadata.js +36 -0
- package/lib/util/getRelayHandleKey.js +2 -2
- package/lib/util/getRequestIdentifier.js +2 -2
- package/lib/util/getValueAtPath.js +51 -0
- package/lib/util/isEmptyObject.js +1 -1
- package/lib/util/registerEnvironmentWithDevTools.js +26 -0
- package/lib/util/withDuration.js +31 -0
- package/multi-actor-environment/ActorIdentifier.js.flow +43 -0
- package/multi-actor-environment/ActorSpecificEnvironment.js.flow +225 -0
- package/multi-actor-environment/ActorUtils.js.flow +33 -0
- package/multi-actor-environment/MultiActorEnvironment.js.flow +506 -0
- package/multi-actor-environment/MultiActorEnvironmentTypes.js.flow +261 -0
- package/multi-actor-environment/index.js.flow +26 -0
- package/mutations/RelayDeclarativeMutationConfig.js.flow +32 -26
- package/mutations/RelayRecordProxy.js.flow +4 -5
- package/mutations/RelayRecordSourceMutator.js.flow +4 -6
- package/mutations/RelayRecordSourceProxy.js.flow +19 -10
- package/mutations/RelayRecordSourceSelectorProxy.js.flow +22 -7
- package/mutations/applyOptimisticMutation.js.flow +13 -14
- package/mutations/commitLocalUpdate.js.flow +1 -1
- package/mutations/commitMutation.js.flow +35 -46
- package/mutations/readUpdatableQuery_EXPERIMENTAL.js.flow +309 -0
- package/mutations/validateMutation.js.flow +28 -16
- package/network/ConvertToExecuteFunction.js.flow +2 -2
- package/network/RelayNetwork.js.flow +4 -5
- package/network/RelayNetworkTypes.js.flow +17 -8
- package/network/RelayObservable.js.flow +1 -1
- package/network/RelayQueryResponseCache.js.flow +34 -20
- package/network/wrapNetworkWithLogObserver.js.flow +100 -0
- package/package.json +3 -2
- package/query/GraphQLTag.js.flow +9 -9
- package/query/PreloadableQueryRegistry.js.flow +2 -1
- package/query/fetchQuery.js.flow +11 -13
- package/query/fetchQueryInternal.js.flow +6 -9
- package/query/fetchQuery_DEPRECATED.js.flow +6 -6
- package/relay-runtime.js +2 -2
- package/relay-runtime.min.js +2 -2
- package/store/ClientID.js.flow +14 -3
- package/store/DataChecker.js.flow +162 -67
- package/store/{RelayModernQueryExecutor.js.flow → OperationExecutor.js.flow} +616 -283
- package/store/RelayConcreteVariables.js.flow +27 -5
- package/store/RelayModernEnvironment.js.flow +176 -235
- package/store/RelayModernFragmentSpecResolver.js.flow +55 -31
- package/store/RelayModernOperationDescriptor.js.flow +12 -7
- package/store/RelayModernRecord.js.flow +67 -11
- package/store/RelayModernSelector.js.flow +24 -14
- package/store/RelayModernStore.js.flow +72 -36
- package/store/RelayOperationTracker.js.flow +59 -43
- package/store/RelayOptimisticRecordSource.js.flow +2 -2
- package/store/RelayPublishQueue.js.flow +79 -34
- package/store/RelayReader.js.flow +351 -72
- package/store/RelayRecordSource.js.flow +72 -6
- package/store/RelayReferenceMarker.js.flow +60 -33
- package/store/RelayResponseNormalizer.js.flow +288 -102
- package/store/RelayStoreReactFlightUtils.js.flow +9 -13
- package/store/RelayStoreSubscriptions.js.flow +19 -11
- package/store/RelayStoreTypes.js.flow +210 -44
- package/store/RelayStoreUtils.js.flow +25 -11
- package/store/ResolverCache.js.flow +249 -0
- package/store/ResolverFragments.js.flow +121 -0
- package/store/StoreInspector.js.flow +2 -2
- package/store/TypeID.js.flow +1 -1
- package/store/ViewerPattern.js.flow +2 -2
- package/store/cloneRelayHandleSourceField.js.flow +5 -6
- package/store/cloneRelayScalarHandleSourceField.js.flow +5 -6
- package/store/createFragmentSpecResolver.js.flow +3 -4
- package/store/createRelayContext.js.flow +3 -3
- package/store/defaultGetDataID.js.flow +3 -1
- package/store/normalizeRelayPayload.js.flow +6 -7
- package/store/readInlineData.js.flow +7 -8
- package/subscription/requestSubscription.js.flow +54 -27
- package/util/NormalizationNode.js.flow +16 -3
- package/util/ReaderNode.js.flow +38 -2
- package/util/RelayConcreteNode.js.flow +4 -0
- package/util/RelayFeatureFlags.js.flow +24 -8
- package/util/RelayProfiler.js.flow +22 -194
- package/util/RelayReplaySubject.js.flow +9 -9
- package/util/RelayRuntimeTypes.js.flow +73 -4
- package/util/StringInterner.js.flow +69 -0
- package/util/createPayloadFor3DField.js.flow +3 -3
- package/util/deepFreeze.js.flow +2 -1
- package/util/getFragmentIdentifier.js.flow +27 -15
- package/util/getOperation.js.flow +2 -2
- package/util/getPaginationMetadata.js.flow +72 -0
- package/util/getPaginationVariables.js.flow +108 -0
- package/util/getPendingOperationsForFragment.js.flow +62 -0
- package/util/getRefetchMetadata.js.flow +79 -0
- package/util/getRelayHandleKey.js.flow +1 -2
- package/util/getRequestIdentifier.js.flow +3 -3
- package/util/getValueAtPath.js.flow +46 -0
- package/util/isEmptyObject.js.flow +2 -1
- package/util/registerEnvironmentWithDevTools.js.flow +33 -0
- package/util/resolveImmediate.js.flow +1 -1
- package/util/withDuration.js.flow +32 -0
- package/lib/store/RelayRecordSourceMapImpl.js +0 -107
- package/lib/store/RelayStoreSubscriptionsUsingMapByID.js +0 -318
- package/store/RelayRecordSourceMapImpl.js.flow +0 -91
- package/store/RelayStoreSubscriptionsUsingMapByID.js.flow +0 -283
|
@@ -12,17 +12,83 @@
|
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
import type {DataID} from '../util/RelayRuntimeTypes';
|
|
16
|
+
import type {RecordState} from './RelayRecordState';
|
|
17
|
+
import type {
|
|
18
|
+
MutableRecordSource,
|
|
19
|
+
Record,
|
|
20
|
+
RecordObjectMap,
|
|
21
|
+
} from './RelayStoreTypes';
|
|
16
22
|
|
|
17
|
-
|
|
23
|
+
const RelayRecordState = require('./RelayRecordState');
|
|
18
24
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
const {EXISTENT, NONEXISTENT, UNKNOWN} = RelayRecordState;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* An implementation of the `MutableRecordSource` interface (defined in
|
|
29
|
+
* `RelayStoreTypes`) that holds all records in memory (JS Map).
|
|
30
|
+
*/
|
|
31
|
+
class RelayRecordSource implements MutableRecordSource {
|
|
32
|
+
_records: Map<DataID, ?Record>;
|
|
33
|
+
|
|
34
|
+
constructor(records?: RecordObjectMap) {
|
|
35
|
+
this._records = new Map();
|
|
36
|
+
if (records != null) {
|
|
37
|
+
Object.keys(records).forEach(key => {
|
|
38
|
+
this._records.set(key, records[key]);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
22
41
|
}
|
|
23
42
|
|
|
24
43
|
static create(records?: RecordObjectMap): MutableRecordSource {
|
|
25
|
-
return new
|
|
44
|
+
return new RelayRecordSource(records);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
clear(): void {
|
|
48
|
+
this._records = new Map();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
delete(dataID: DataID): void {
|
|
52
|
+
this._records.set(dataID, null);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
get(dataID: DataID): ?Record {
|
|
56
|
+
return this._records.get(dataID);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
getRecordIDs(): Array<DataID> {
|
|
60
|
+
return Array.from(this._records.keys());
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
getStatus(dataID: DataID): RecordState {
|
|
64
|
+
if (!this._records.has(dataID)) {
|
|
65
|
+
return UNKNOWN;
|
|
66
|
+
}
|
|
67
|
+
return this._records.get(dataID) == null ? NONEXISTENT : EXISTENT;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
has(dataID: DataID): boolean {
|
|
71
|
+
return this._records.has(dataID);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
remove(dataID: DataID): void {
|
|
75
|
+
this._records.delete(dataID);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
set(dataID: DataID, record: Record): void {
|
|
79
|
+
this._records.set(dataID, record);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
size(): number {
|
|
83
|
+
return this._records.size;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
toJSON(): {[DataID]: ?Record, ...} {
|
|
87
|
+
const obj = {};
|
|
88
|
+
for (const [key, value] of this._records) {
|
|
89
|
+
obj[key] = value;
|
|
90
|
+
}
|
|
91
|
+
return obj;
|
|
26
92
|
}
|
|
27
93
|
}
|
|
28
94
|
|
|
@@ -12,19 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
const RelayConcreteNode = require('../util/RelayConcreteNode');
|
|
16
|
-
const RelayFeatureFlags = require('../util/RelayFeatureFlags');
|
|
17
|
-
const RelayModernRecord = require('./RelayModernRecord');
|
|
18
|
-
const RelayStoreReactFlightUtils = require('./RelayStoreReactFlightUtils');
|
|
19
|
-
const RelayStoreUtils = require('./RelayStoreUtils');
|
|
20
|
-
|
|
21
|
-
const cloneRelayHandleSourceField = require('./cloneRelayHandleSourceField');
|
|
22
|
-
const getOperation = require('../util/getOperation');
|
|
23
|
-
const invariant = require('invariant');
|
|
24
|
-
|
|
25
|
-
const {generateTypeID} = require('./TypeID');
|
|
26
|
-
|
|
27
|
-
import type {ReactFlightPayloadQuery} from '../network/RelayNetworkTypes';
|
|
28
15
|
import type {
|
|
29
16
|
NormalizationFlightField,
|
|
30
17
|
NormalizationLinkedField,
|
|
@@ -37,12 +24,26 @@ import type {
|
|
|
37
24
|
DataIDSet,
|
|
38
25
|
NormalizationSelector,
|
|
39
26
|
OperationLoader,
|
|
27
|
+
ReactFlightReachableExecutableDefinitions,
|
|
40
28
|
Record,
|
|
41
29
|
RecordSource,
|
|
42
30
|
} from './RelayStoreTypes';
|
|
43
31
|
|
|
32
|
+
const getOperation = require('../util/getOperation');
|
|
33
|
+
const RelayConcreteNode = require('../util/RelayConcreteNode');
|
|
34
|
+
const RelayFeatureFlags = require('../util/RelayFeatureFlags');
|
|
35
|
+
const cloneRelayHandleSourceField = require('./cloneRelayHandleSourceField');
|
|
36
|
+
const {getLocalVariables} = require('./RelayConcreteVariables');
|
|
37
|
+
const RelayModernRecord = require('./RelayModernRecord');
|
|
38
|
+
const RelayStoreReactFlightUtils = require('./RelayStoreReactFlightUtils');
|
|
39
|
+
const RelayStoreUtils = require('./RelayStoreUtils');
|
|
40
|
+
const {generateTypeID} = require('./TypeID');
|
|
41
|
+
const invariant = require('invariant');
|
|
42
|
+
|
|
44
43
|
const {
|
|
44
|
+
ACTOR_CHANGE,
|
|
45
45
|
CONDITION,
|
|
46
|
+
CLIENT_COMPONENT,
|
|
46
47
|
CLIENT_EXTENSION,
|
|
47
48
|
DEFER,
|
|
48
49
|
FLIGHT_FIELD,
|
|
@@ -63,6 +64,7 @@ function mark(
|
|
|
63
64
|
selector: NormalizationSelector,
|
|
64
65
|
references: DataIDSet,
|
|
65
66
|
operationLoader: ?OperationLoader,
|
|
67
|
+
shouldProcessClientComponents: ?boolean,
|
|
66
68
|
): void {
|
|
67
69
|
const {dataID, node, variables} = selector;
|
|
68
70
|
const marker = new RelayReferenceMarker(
|
|
@@ -70,6 +72,7 @@ function mark(
|
|
|
70
72
|
variables,
|
|
71
73
|
references,
|
|
72
74
|
operationLoader,
|
|
75
|
+
shouldProcessClientComponents,
|
|
73
76
|
);
|
|
74
77
|
marker.mark(node, dataID);
|
|
75
78
|
}
|
|
@@ -83,18 +86,21 @@ class RelayReferenceMarker {
|
|
|
83
86
|
_recordSource: RecordSource;
|
|
84
87
|
_references: DataIDSet;
|
|
85
88
|
_variables: Variables;
|
|
89
|
+
_shouldProcessClientComponents: ?boolean;
|
|
86
90
|
|
|
87
91
|
constructor(
|
|
88
92
|
recordSource: RecordSource,
|
|
89
93
|
variables: Variables,
|
|
90
94
|
references: DataIDSet,
|
|
91
95
|
operationLoader: ?OperationLoader,
|
|
96
|
+
shouldProcessClientComponents: ?boolean,
|
|
92
97
|
) {
|
|
93
98
|
this._operationLoader = operationLoader ?? null;
|
|
94
99
|
this._operationName = null;
|
|
95
100
|
this._recordSource = recordSource;
|
|
96
101
|
this._references = references;
|
|
97
102
|
this._variables = variables;
|
|
103
|
+
this._shouldProcessClientComponents = shouldProcessClientComponents;
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
mark(node: NormalizationNode, dataID: DataID): void {
|
|
@@ -129,6 +135,10 @@ class RelayReferenceMarker {
|
|
|
129
135
|
selections.forEach(selection => {
|
|
130
136
|
/* eslint-disable no-fallthrough */
|
|
131
137
|
switch (selection.kind) {
|
|
138
|
+
case ACTOR_CHANGE:
|
|
139
|
+
// TODO: T89695151 Support multi-actor record sources in RelayReferenceMarker.js
|
|
140
|
+
this._traverseLink(selection.linkedField, record);
|
|
141
|
+
break;
|
|
132
142
|
case LINKED_FIELD:
|
|
133
143
|
if (selection.plural) {
|
|
134
144
|
this._traversePluralLink(selection, record);
|
|
@@ -137,7 +147,9 @@ class RelayReferenceMarker {
|
|
|
137
147
|
}
|
|
138
148
|
break;
|
|
139
149
|
case CONDITION:
|
|
140
|
-
const conditionValue =
|
|
150
|
+
const conditionValue = Boolean(
|
|
151
|
+
this._getVariableValue(selection.condition),
|
|
152
|
+
);
|
|
141
153
|
if (conditionValue === selection.passingValue) {
|
|
142
154
|
this._traverseSelections(selection.selections, record);
|
|
143
155
|
}
|
|
@@ -148,18 +160,22 @@ class RelayReferenceMarker {
|
|
|
148
160
|
if (typeName != null && typeName === selection.type) {
|
|
149
161
|
this._traverseSelections(selection.selections, record);
|
|
150
162
|
}
|
|
151
|
-
} else
|
|
163
|
+
} else {
|
|
152
164
|
const typeName = RelayModernRecord.getType(record);
|
|
153
165
|
const typeID = generateTypeID(typeName);
|
|
154
166
|
this._references.add(typeID);
|
|
155
167
|
this._traverseSelections(selection.selections, record);
|
|
156
|
-
} else {
|
|
157
|
-
this._traverseSelections(selection.selections, record);
|
|
158
168
|
}
|
|
159
169
|
break;
|
|
160
|
-
// $FlowFixMe[incompatible-type]
|
|
161
170
|
case FRAGMENT_SPREAD:
|
|
171
|
+
const prevVariables = this._variables;
|
|
172
|
+
this._variables = getLocalVariables(
|
|
173
|
+
this._variables,
|
|
174
|
+
selection.fragment.argumentDefinitions,
|
|
175
|
+
selection.args,
|
|
176
|
+
);
|
|
162
177
|
this._traverseSelections(selection.fragment.selections, record);
|
|
178
|
+
this._variables = prevVariables;
|
|
163
179
|
break;
|
|
164
180
|
case LINKED_HANDLE:
|
|
165
181
|
// The selections for a "handle" field are the same as those of the
|
|
@@ -190,11 +206,9 @@ class RelayReferenceMarker {
|
|
|
190
206
|
case SCALAR_HANDLE:
|
|
191
207
|
break;
|
|
192
208
|
case TYPE_DISCRIMINATOR: {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
this._references.add(typeID);
|
|
197
|
-
}
|
|
209
|
+
const typeName = RelayModernRecord.getType(record);
|
|
210
|
+
const typeID = generateTypeID(typeName);
|
|
211
|
+
this._references.add(typeID);
|
|
198
212
|
break;
|
|
199
213
|
}
|
|
200
214
|
case MODULE_IMPORT:
|
|
@@ -210,6 +224,12 @@ class RelayReferenceMarker {
|
|
|
210
224
|
throw new Error('Flight fields are not yet supported.');
|
|
211
225
|
}
|
|
212
226
|
break;
|
|
227
|
+
case CLIENT_COMPONENT:
|
|
228
|
+
if (this._shouldProcessClientComponents === false) {
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
this._traverseSelections(selection.fragment.selections, record);
|
|
232
|
+
break;
|
|
213
233
|
default:
|
|
214
234
|
(selection: empty);
|
|
215
235
|
invariant(
|
|
@@ -240,8 +260,15 @@ class RelayReferenceMarker {
|
|
|
240
260
|
}
|
|
241
261
|
const normalizationRootNode = operationLoader.get(operationReference);
|
|
242
262
|
if (normalizationRootNode != null) {
|
|
243
|
-
const
|
|
244
|
-
this.
|
|
263
|
+
const operation = getOperation(normalizationRootNode);
|
|
264
|
+
const prevVariables = this._variables;
|
|
265
|
+
this._variables = getLocalVariables(
|
|
266
|
+
this._variables,
|
|
267
|
+
operation.argumentDefinitions,
|
|
268
|
+
moduleImport.args,
|
|
269
|
+
);
|
|
270
|
+
this._traverseSelections(operation.selections, record);
|
|
271
|
+
this._variables = prevVariables;
|
|
245
272
|
}
|
|
246
273
|
// Otherwise, if the operation is not available, we assume that the data
|
|
247
274
|
// cannot have been processed yet and therefore isn't in the store to
|
|
@@ -286,12 +313,12 @@ class RelayReferenceMarker {
|
|
|
286
313
|
return;
|
|
287
314
|
}
|
|
288
315
|
|
|
289
|
-
const
|
|
316
|
+
const reachableExecutableDefinitions = RelayModernRecord.getValue(
|
|
290
317
|
reactFlightClientResponseRecord,
|
|
291
|
-
RelayStoreReactFlightUtils.
|
|
318
|
+
RelayStoreReactFlightUtils.REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY,
|
|
292
319
|
);
|
|
293
320
|
|
|
294
|
-
if (!Array.isArray(
|
|
321
|
+
if (!Array.isArray(reachableExecutableDefinitions)) {
|
|
295
322
|
return;
|
|
296
323
|
}
|
|
297
324
|
|
|
@@ -301,13 +328,13 @@ class RelayReferenceMarker {
|
|
|
301
328
|
'DataChecker: Expected an operationLoader to be configured when using ' +
|
|
302
329
|
'React Flight',
|
|
303
330
|
);
|
|
304
|
-
// In Flight, the variables that are in scope for reachable
|
|
305
|
-
// the same as what's in scope for the outer query.
|
|
331
|
+
// In Flight, the variables that are in scope for reachable executable
|
|
332
|
+
// definitions aren't the same as what's in scope for the outer query.
|
|
306
333
|
const prevVariables = this._variables;
|
|
307
334
|
// $FlowFixMe[incompatible-cast]
|
|
308
|
-
for (const
|
|
309
|
-
this._variables =
|
|
310
|
-
const operationReference =
|
|
335
|
+
for (const definition of (reachableExecutableDefinitions: Array<ReactFlightReachableExecutableDefinitions>)) {
|
|
336
|
+
this._variables = definition.variables;
|
|
337
|
+
const operationReference = definition.module;
|
|
311
338
|
const normalizationRootNode = operationLoader.get(operationReference);
|
|
312
339
|
if (normalizationRootNode != null) {
|
|
313
340
|
const operation = getOperation(normalizationRootNode);
|