relay-runtime 18.2.0 → 19.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.
- package/experimental.js +1 -1
- package/experimental.js.flow +8 -6
- package/index.js +1 -1
- package/index.js.flow +3 -0
- package/lib/experimental.js +5 -2
- package/lib/index.js +3 -0
- package/lib/multi-actor-environment/ActorSpecificEnvironment.js +1 -1
- package/lib/mutations/RelayRecordSourceProxy.js +2 -1
- package/lib/mutations/createUpdatableProxy.js +1 -1
- package/lib/mutations/validateMutation.js +2 -2
- package/lib/network/RelayObservable.js +1 -3
- package/lib/network/wrapNetworkWithLogObserver.js +2 -2
- package/lib/query/fetchQuery.js +1 -1
- package/lib/store/DataChecker.js +4 -5
- package/lib/store/OperationExecutor.js +11 -0
- package/lib/store/RelayModernEnvironment.js +13 -4
- package/lib/store/RelayModernFragmentSpecResolver.js +4 -4
- package/lib/store/RelayModernStore.js +43 -21
- package/lib/store/RelayPublishQueue.js +11 -15
- package/lib/store/RelayReader.js +131 -151
- package/lib/store/RelayReferenceMarker.js +3 -4
- package/lib/store/RelayResponseNormalizer.js +47 -26
- package/lib/store/RelayStoreSubscriptions.js +2 -2
- package/lib/store/RelayStoreUtils.js +8 -0
- package/lib/store/ResolverFragments.js +2 -2
- package/lib/store/createRelayLoggingContext.js +17 -0
- package/lib/store/generateTypenamePrefixedDataID.js +9 -0
- package/lib/store/live-resolvers/LiveResolverCache.js +2 -1
- package/lib/store/live-resolvers/resolverDataInjector.js +4 -4
- package/lib/store/observeFragmentExperimental.js +60 -13
- package/lib/store/observeQueryExperimental.js +21 -0
- package/lib/util/RelayFeatureFlags.js +6 -1
- package/lib/util/handlePotentialSnapshotErrors.js +11 -8
- package/multi-actor-environment/ActorSpecificEnvironment.js.flow +1 -0
- package/mutations/RelayRecordSourceProxy.js.flow +4 -0
- package/mutations/createUpdatableProxy.js.flow +1 -1
- package/mutations/validateMutation.js.flow +3 -3
- package/network/RelayNetworkTypes.js.flow +3 -0
- package/network/RelayObservable.js.flow +1 -5
- package/network/wrapNetworkWithLogObserver.js.flow +19 -1
- package/package.json +1 -1
- package/query/fetchQuery.js.flow +1 -1
- package/store/DataChecker.js.flow +5 -2
- package/store/OperationExecutor.js.flow +12 -1
- package/store/RelayExperimentalGraphResponseTransform.js.flow +4 -4
- package/store/RelayModernEnvironment.js.flow +22 -6
- package/store/RelayModernFragmentSpecResolver.js.flow +6 -6
- package/store/RelayModernSelector.js.flow +2 -0
- package/store/RelayModernStore.js.flow +74 -27
- package/store/RelayPublishQueue.js.flow +32 -21
- package/store/RelayReader.js.flow +159 -96
- package/store/RelayReferenceMarker.js.flow +3 -4
- package/store/RelayResponseNormalizer.js.flow +93 -67
- package/store/RelayStoreSubscriptions.js.flow +2 -2
- package/store/RelayStoreTypes.js.flow +33 -4
- package/store/RelayStoreUtils.js.flow +29 -0
- package/store/ResolverCache.js.flow +2 -2
- package/store/ResolverFragments.js.flow +5 -3
- package/store/StoreInspector.js.flow +5 -0
- package/store/createRelayContext.js.flow +3 -2
- package/store/createRelayLoggingContext.js.flow +46 -0
- package/store/generateTypenamePrefixedDataID.js.flow +25 -0
- package/store/live-resolvers/LiveResolverCache.js.flow +2 -1
- package/store/live-resolvers/resolverDataInjector.js.flow +10 -6
- package/store/observeFragmentExperimental.js.flow +82 -28
- package/store/observeQueryExperimental.js.flow +61 -0
- package/store/waitForFragmentExperimental.js.flow +4 -3
- package/util/NormalizationNode.js.flow +2 -1
- package/util/RelayConcreteNode.js.flow +2 -0
- package/util/RelayError.js.flow +1 -0
- package/util/RelayFeatureFlags.js.flow +18 -0
- package/util/RelayRuntimeTypes.js.flow +6 -3
- package/util/getPaginationVariables.js.flow +2 -0
- package/util/handlePotentialSnapshotErrors.js.flow +23 -11
- package/util/registerEnvironmentWithDevTools.js.flow +4 -2
- package/util/withProvidedVariables.js.flow +1 -0
- package/util/withStartAndDuration.js.flow +3 -0
- package/relay-runtime-experimental.js +0 -4
- package/relay-runtime-experimental.min.js +0 -9
- package/relay-runtime.js +0 -4
- package/relay-runtime.min.js +0 -9
package/experimental.js
CHANGED
package/experimental.js.flow
CHANGED
|
@@ -16,6 +16,7 @@ import type {DataID} from './util/RelayRuntimeTypes';
|
|
|
16
16
|
|
|
17
17
|
const resolverDataInjector = require('./store/live-resolvers/resolverDataInjector');
|
|
18
18
|
const {observeFragment} = require('./store/observeFragmentExperimental');
|
|
19
|
+
const {observeQuery} = require('./store/observeQueryExperimental');
|
|
19
20
|
const {waitForFragmentData} = require('./store/waitForFragmentExperimental');
|
|
20
21
|
|
|
21
22
|
// Annotates a strong object return type, where `A` is the GraphQL typename and `Typename` is the
|
|
@@ -43,13 +44,13 @@ export type IdOf<A: string, Typename: void | string = void> = [
|
|
|
43
44
|
export type RelayResolverValue<A> = $NonMaybeType<A>;
|
|
44
45
|
|
|
45
46
|
type ErrorResult<Error> = {
|
|
46
|
-
ok: false,
|
|
47
|
-
errors: $ReadOnlyArray<Error>,
|
|
47
|
+
+ok: false,
|
|
48
|
+
+errors: $ReadOnlyArray<Error>,
|
|
48
49
|
};
|
|
49
50
|
|
|
50
51
|
type OkayResult<T> = {
|
|
51
|
-
ok: true,
|
|
52
|
-
value: T,
|
|
52
|
+
+ok: true,
|
|
53
|
+
+value: T,
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
export type Result<T, Error> = OkayResult<T> | ErrorResult<Error>;
|
|
@@ -57,19 +58,20 @@ export type Result<T, Error> = OkayResult<T> | ErrorResult<Error>;
|
|
|
57
58
|
function isValueResult<T = mixed>(
|
|
58
59
|
input: Result<T, Error>,
|
|
59
60
|
): input is OkayResult<T> {
|
|
60
|
-
return input.ok === true;
|
|
61
|
+
return input.ok === (true as const);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
function isErrorResult<T = mixed>(
|
|
64
65
|
input: Result<T, Error>,
|
|
65
66
|
): input is ErrorResult<Error> {
|
|
66
|
-
return input.ok === false;
|
|
67
|
+
return input.ok === (false as const);
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
module.exports = {
|
|
70
71
|
resolverDataInjector,
|
|
71
72
|
isValueResult,
|
|
72
73
|
isErrorResult,
|
|
74
|
+
observeQuery,
|
|
73
75
|
observeFragment,
|
|
74
76
|
waitForFragmentData,
|
|
75
77
|
};
|
package/index.js
CHANGED
package/index.js.flow
CHANGED
|
@@ -35,6 +35,7 @@ const {
|
|
|
35
35
|
} = require('./store/ClientID');
|
|
36
36
|
const createFragmentSpecResolver = require('./store/createFragmentSpecResolver');
|
|
37
37
|
const createRelayContext = require('./store/createRelayContext');
|
|
38
|
+
const createRelayLoggingContext = require('./store/createRelayLoggingContext');
|
|
38
39
|
const isRelayModernEnvironment = require('./store/isRelayModernEnvironment');
|
|
39
40
|
const {
|
|
40
41
|
isSuspenseSentinel,
|
|
@@ -316,6 +317,7 @@ module.exports = {
|
|
|
316
317
|
suspenseSentinel,
|
|
317
318
|
isRequest: GraphQLTag.isRequest,
|
|
318
319
|
readInlineData,
|
|
320
|
+
readFragment: ResolverFragments.readFragment,
|
|
319
321
|
|
|
320
322
|
// Declarative mutation API
|
|
321
323
|
MutationTypes: RelayDeclarativeMutationConfig.MutationTypes,
|
|
@@ -379,6 +381,7 @@ module.exports = {
|
|
|
379
381
|
ResolverFragments,
|
|
380
382
|
OperationTracker: RelayOperationTracker,
|
|
381
383
|
createRelayContext: createRelayContext,
|
|
384
|
+
createRelayLoggingContext: createRelayLoggingContext,
|
|
382
385
|
getOperationVariables: RelayConcreteVariables.getOperationVariables,
|
|
383
386
|
getLocalVariables: RelayConcreteVariables.getLocalVariables,
|
|
384
387
|
fetchQuery: fetchQueryInternal.fetchQuery,
|
package/lib/experimental.js
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
var resolverDataInjector = require('./store/live-resolvers/resolverDataInjector');
|
|
4
4
|
var _require = require('./store/observeFragmentExperimental'),
|
|
5
5
|
observeFragment = _require.observeFragment;
|
|
6
|
-
var _require2 = require('./store/
|
|
7
|
-
|
|
6
|
+
var _require2 = require('./store/observeQueryExperimental'),
|
|
7
|
+
observeQuery = _require2.observeQuery;
|
|
8
|
+
var _require3 = require('./store/waitForFragmentExperimental'),
|
|
9
|
+
waitForFragmentData = _require3.waitForFragmentData;
|
|
8
10
|
function isValueResult(input) {
|
|
9
11
|
return input.ok === true;
|
|
10
12
|
}
|
|
@@ -15,6 +17,7 @@ module.exports = {
|
|
|
15
17
|
resolverDataInjector: resolverDataInjector,
|
|
16
18
|
isValueResult: isValueResult,
|
|
17
19
|
isErrorResult: isErrorResult,
|
|
20
|
+
observeQuery: observeQuery,
|
|
18
21
|
observeFragment: observeFragment,
|
|
19
22
|
waitForFragmentData: waitForFragmentData
|
|
20
23
|
};
|
package/lib/index.js
CHANGED
|
@@ -25,6 +25,7 @@ var _require2 = require('./store/ClientID'),
|
|
|
25
25
|
isClientID = _require2.isClientID;
|
|
26
26
|
var createFragmentSpecResolver = require('./store/createFragmentSpecResolver');
|
|
27
27
|
var createRelayContext = require('./store/createRelayContext');
|
|
28
|
+
var createRelayLoggingContext = require('./store/createRelayLoggingContext');
|
|
28
29
|
var isRelayModernEnvironment = require('./store/isRelayModernEnvironment');
|
|
29
30
|
var _require3 = require('./store/live-resolvers/LiveResolverSuspenseSentinel'),
|
|
30
31
|
isSuspenseSentinel = _require3.isSuspenseSentinel,
|
|
@@ -123,6 +124,7 @@ module.exports = {
|
|
|
123
124
|
suspenseSentinel: suspenseSentinel,
|
|
124
125
|
isRequest: GraphQLTag.isRequest,
|
|
125
126
|
readInlineData: readInlineData,
|
|
127
|
+
readFragment: ResolverFragments.readFragment,
|
|
126
128
|
MutationTypes: RelayDeclarativeMutationConfig.MutationTypes,
|
|
127
129
|
RangeOperations: RelayDeclarativeMutationConfig.RangeOperations,
|
|
128
130
|
DefaultHandlerProvider: RelayDefaultHandlerProvider,
|
|
@@ -173,6 +175,7 @@ module.exports = {
|
|
|
173
175
|
ResolverFragments: ResolverFragments,
|
|
174
176
|
OperationTracker: RelayOperationTracker,
|
|
175
177
|
createRelayContext: createRelayContext,
|
|
178
|
+
createRelayLoggingContext: createRelayLoggingContext,
|
|
176
179
|
getOperationVariables: RelayConcreteVariables.getOperationVariables,
|
|
177
180
|
getLocalVariables: RelayConcreteVariables.getLocalVariables,
|
|
178
181
|
fetchQuery: fetchQueryInternal.fetchQuery,
|
|
@@ -16,7 +16,7 @@ var ActorSpecificEnvironment = /*#__PURE__*/function () {
|
|
|
16
16
|
this._operationTracker = new RelayOperationTracker();
|
|
17
17
|
this._store = config.store;
|
|
18
18
|
this._network = wrapNetworkWithLogObserver(this, config.network);
|
|
19
|
-
this._publishQueue = new RelayPublishQueue(config.store, config.handlerProvider, defaultGetDataID, config.missingFieldHandlers);
|
|
19
|
+
this._publishQueue = new RelayPublishQueue(config.store, config.handlerProvider, defaultGetDataID, config.missingFieldHandlers, this.__log);
|
|
20
20
|
this._defaultRenderPolicy = config.defaultRenderPolicy;
|
|
21
21
|
this.options = {
|
|
22
22
|
actorID: this.actorIdentifier
|
|
@@ -14,7 +14,7 @@ var _require4 = require('./readUpdatableQuery'),
|
|
|
14
14
|
var RelayRecordProxy = require('./RelayRecordProxy');
|
|
15
15
|
var invariant = require('invariant');
|
|
16
16
|
var RelayRecordSourceProxy = /*#__PURE__*/function () {
|
|
17
|
-
function RelayRecordSourceProxy(mutator, getDataID, handlerProvider, missingFieldHandlers) {
|
|
17
|
+
function RelayRecordSourceProxy(mutator, getDataID, handlerProvider, missingFieldHandlers, log) {
|
|
18
18
|
this.__mutator = mutator;
|
|
19
19
|
this._handlerProvider = handlerProvider || null;
|
|
20
20
|
this._proxies = {};
|
|
@@ -22,6 +22,7 @@ var RelayRecordSourceProxy = /*#__PURE__*/function () {
|
|
|
22
22
|
this._invalidatedStore = false;
|
|
23
23
|
this._idsMarkedForInvalidation = new Set();
|
|
24
24
|
this._missingFieldHandlers = missingFieldHandlers;
|
|
25
|
+
this._log = log !== null && log !== void 0 ? log : function (LogEvent) {};
|
|
25
26
|
}
|
|
26
27
|
var _proto = RelayRecordSourceProxy.prototype;
|
|
27
28
|
_proto.publishSource = function publishSource(source, fieldPayloads) {
|
|
@@ -71,11 +71,11 @@ function updateProxyFromSelections(mutableUpdatableProxy, updatableProxyRootReco
|
|
|
71
71
|
case 'ClientEdgeToServerObject':
|
|
72
72
|
case 'Defer':
|
|
73
73
|
case 'ModuleImport':
|
|
74
|
-
case 'RelayLiveResolver':
|
|
75
74
|
case 'RequiredField':
|
|
76
75
|
case 'CatchField':
|
|
77
76
|
case 'Stream':
|
|
78
77
|
case 'RelayResolver':
|
|
78
|
+
case 'RelayLiveResolver':
|
|
79
79
|
throw new Error('Encountered an unexpected ReaderSelection variant in RelayRecordSourceProxy. This indicates a bug in Relay.');
|
|
80
80
|
default:
|
|
81
81
|
selection.kind;
|
|
@@ -72,13 +72,13 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
72
72
|
return validateModuleImport(context);
|
|
73
73
|
case 'TypeDiscriminator':
|
|
74
74
|
return validateAbstractKey(context, selection.abstractKey);
|
|
75
|
-
case 'RelayResolver':
|
|
76
|
-
case 'RelayLiveResolver':
|
|
77
75
|
case 'ClientEdgeToClientObject':
|
|
78
76
|
case 'LinkedHandle':
|
|
79
77
|
case 'ScalarHandle':
|
|
80
78
|
case 'Defer':
|
|
81
79
|
case 'Stream':
|
|
80
|
+
case 'RelayResolver':
|
|
81
|
+
case 'RelayLiveResolver':
|
|
82
82
|
{
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
@@ -364,9 +364,7 @@ function _subscribe(source, observer) {
|
|
|
364
364
|
function swallowError(_error, _isUncaughtThrownError) {}
|
|
365
365
|
if (process.env.NODE_ENV !== "production") {
|
|
366
366
|
RelayObservable.onUnhandledError(function (error, isUncaughtThrownError) {
|
|
367
|
-
if (
|
|
368
|
-
fail(String(error));
|
|
369
|
-
} else if (isUncaughtThrownError) {
|
|
367
|
+
if (isUncaughtThrownError) {
|
|
370
368
|
setTimeout(function () {
|
|
371
369
|
throw error;
|
|
372
370
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var generateID = require('../util/generateID');
|
|
4
4
|
function wrapNetworkWithLogObserver(env, network) {
|
|
5
5
|
return {
|
|
6
|
-
execute: function execute(params, variables, cacheConfig, uploadables) {
|
|
6
|
+
execute: function execute(params, variables, cacheConfig, uploadables, _, encryptedVariables, preprocessResponse, checkOperation) {
|
|
7
7
|
var networkRequestId = generateID();
|
|
8
8
|
var logObserver = {
|
|
9
9
|
start: function start(subscription) {
|
|
@@ -49,7 +49,7 @@ function wrapNetworkWithLogObserver(env, network) {
|
|
|
49
49
|
info: info
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
|
-
return network.execute(params, variables, cacheConfig, uploadables, logRequestInfo)["do"](logObserver);
|
|
52
|
+
return network.execute(params, variables, cacheConfig, uploadables, logRequestInfo, encryptedVariables, preprocessResponse, checkOperation)["do"](logObserver);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
}
|
package/lib/query/fetchQuery.js
CHANGED
|
@@ -21,7 +21,7 @@ function fetchQuery(environment, query, variables, options) {
|
|
|
21
21
|
var operation = createOperationDescriptor(queryNode, variables, networkCacheConfig);
|
|
22
22
|
var fetchPolicy = (_options$fetchPolicy = options === null || options === void 0 ? void 0 : options.fetchPolicy) !== null && _options$fetchPolicy !== void 0 ? _options$fetchPolicy : 'network-only';
|
|
23
23
|
function readData(snapshot) {
|
|
24
|
-
handlePotentialSnapshotErrors(environment, snapshot.
|
|
24
|
+
handlePotentialSnapshotErrors(environment, snapshot.fieldErrors);
|
|
25
25
|
return snapshot.data;
|
|
26
26
|
}
|
|
27
27
|
switch (fetchPolicy) {
|
package/lib/store/DataChecker.js
CHANGED
|
@@ -33,7 +33,7 @@ function check(getSourceForActor, getTargetForActor, defaultActorIdentifier, sel
|
|
|
33
33
|
var dataID = selector.dataID,
|
|
34
34
|
node = selector.node,
|
|
35
35
|
variables = selector.variables;
|
|
36
|
-
var checker = new DataChecker(getSourceForActor, getTargetForActor, defaultActorIdentifier, variables, handlers, operationLoader, getDataID, shouldProcessClientComponents);
|
|
36
|
+
var checker = new DataChecker(getSourceForActor, getTargetForActor, defaultActorIdentifier, variables, handlers, operationLoader, getDataID, shouldProcessClientComponents, log);
|
|
37
37
|
var result = checker.check(node, dataID);
|
|
38
38
|
if (log != null) {
|
|
39
39
|
log({
|
|
@@ -44,7 +44,7 @@ function check(getSourceForActor, getTargetForActor, defaultActorIdentifier, sel
|
|
|
44
44
|
return result;
|
|
45
45
|
}
|
|
46
46
|
var DataChecker = /*#__PURE__*/function () {
|
|
47
|
-
function DataChecker(getSourceForActor, getTargetForActor, defaultActorIdentifier, variables, handlers, operationLoader, getDataID, shouldProcessClientComponents) {
|
|
47
|
+
function DataChecker(getSourceForActor, getTargetForActor, defaultActorIdentifier, variables, handlers, operationLoader, getDataID, shouldProcessClientComponents, log) {
|
|
48
48
|
this._getSourceForActor = getSourceForActor;
|
|
49
49
|
this._getTargetForActor = getTargetForActor;
|
|
50
50
|
this._getDataID = getDataID;
|
|
@@ -61,6 +61,7 @@ var DataChecker = /*#__PURE__*/function () {
|
|
|
61
61
|
this._recordWasMissing = false;
|
|
62
62
|
this._variables = variables;
|
|
63
63
|
this._shouldProcessClientComponents = shouldProcessClientComponents;
|
|
64
|
+
this._log = log;
|
|
64
65
|
}
|
|
65
66
|
var _proto = DataChecker.prototype;
|
|
66
67
|
_proto._getMutatorAndRecordProxyForActor = function _getMutatorAndRecordProxyForActor(actorIdentifier) {
|
|
@@ -68,7 +69,7 @@ var DataChecker = /*#__PURE__*/function () {
|
|
|
68
69
|
if (tuple == null) {
|
|
69
70
|
var target = this._getTargetForActor(actorIdentifier);
|
|
70
71
|
var mutator = new RelayRecordSourceMutator(this._getSourceForActor(actorIdentifier), target);
|
|
71
|
-
var recordSourceProxy = new RelayRecordSourceProxy(mutator, this._getDataID, undefined, this._handlers);
|
|
72
|
+
var recordSourceProxy = new RelayRecordSourceProxy(mutator, this._getDataID, undefined, this._handlers, this._log);
|
|
72
73
|
tuple = [mutator, recordSourceProxy];
|
|
73
74
|
this._mutatorRecordSourceProxyCache.set(actorIdentifier, tuple);
|
|
74
75
|
}
|
|
@@ -275,8 +276,6 @@ var DataChecker = /*#__PURE__*/function () {
|
|
|
275
276
|
_this2._traverseSelections(selection.fragment.selections, dataID);
|
|
276
277
|
break;
|
|
277
278
|
case 'RelayResolver':
|
|
278
|
-
_this2._checkResolver(selection, dataID);
|
|
279
|
-
break;
|
|
280
279
|
case 'RelayLiveResolver':
|
|
281
280
|
_this2._checkResolver(selection, dataID);
|
|
282
281
|
break;
|
|
@@ -111,6 +111,12 @@ var Executor = /*#__PURE__*/function () {
|
|
|
111
111
|
variables: _this._operation.request.variables,
|
|
112
112
|
cacheConfig: (_this$_operation$requ = _this._operation.request.cacheConfig) !== null && _this$_operation$requ !== void 0 ? _this$_operation$requ : {}
|
|
113
113
|
});
|
|
114
|
+
},
|
|
115
|
+
unsubscribe: function unsubscribe() {
|
|
116
|
+
_this._log({
|
|
117
|
+
name: 'execute.unsubscribe',
|
|
118
|
+
executeId: _this._executeId
|
|
119
|
+
});
|
|
114
120
|
}
|
|
115
121
|
});
|
|
116
122
|
if (!RelayFeatureFlags.PROCESS_OPTIMISTIC_UPDATE_BEFORE_SUBSCRIPTION && optimisticConfig != null) {
|
|
@@ -378,6 +384,7 @@ var Executor = /*#__PURE__*/function () {
|
|
|
378
384
|
var payload = this._normalizeResponse(response, this._operation.root, ROOT_TYPE, {
|
|
379
385
|
actorIdentifier: this._actorIdentifier,
|
|
380
386
|
getDataID: this._getDataID,
|
|
387
|
+
log: this._log,
|
|
381
388
|
path: [],
|
|
382
389
|
shouldProcessClientComponents: this._shouldProcessClientComponents,
|
|
383
390
|
treatMissingFieldsAsNull: treatMissingFieldsAsNull
|
|
@@ -459,6 +466,7 @@ var Executor = /*#__PURE__*/function () {
|
|
|
459
466
|
}, selector, followupPayload.typeName, {
|
|
460
467
|
actorIdentifier: this._actorIdentifier,
|
|
461
468
|
getDataID: this._getDataID,
|
|
469
|
+
log: this._log,
|
|
462
470
|
path: followupPayload.path,
|
|
463
471
|
treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
|
|
464
472
|
shouldProcessClientComponents: this._shouldProcessClientComponents
|
|
@@ -515,6 +523,7 @@ var Executor = /*#__PURE__*/function () {
|
|
|
515
523
|
var relayPayload = _this8._normalizeResponse(payloadPart, _this8._operation.root, ROOT_TYPE, {
|
|
516
524
|
actorIdentifier: _this8._actorIdentifier,
|
|
517
525
|
getDataID: _this8._getDataID,
|
|
526
|
+
log: _this8._log,
|
|
518
527
|
path: [],
|
|
519
528
|
treatMissingFieldsAsNull: _this8._treatMissingFieldsAsNull,
|
|
520
529
|
shouldProcessClientComponents: _this8._shouldProcessClientComponents
|
|
@@ -801,6 +810,7 @@ var Executor = /*#__PURE__*/function () {
|
|
|
801
810
|
var relayPayload = this._normalizeResponse(response, placeholder.selector, placeholder.typeName, {
|
|
802
811
|
actorIdentifier: this._actorIdentifier,
|
|
803
812
|
getDataID: this._getDataID,
|
|
813
|
+
log: this._log,
|
|
804
814
|
path: placeholder.path,
|
|
805
815
|
treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
|
|
806
816
|
shouldProcessClientComponents: this._shouldProcessClientComponents
|
|
@@ -903,6 +913,7 @@ var Executor = /*#__PURE__*/function () {
|
|
|
903
913
|
var relayPayload = this._normalizeResponse(response, selector, typeName, {
|
|
904
914
|
actorIdentifier: this._actorIdentifier,
|
|
905
915
|
getDataID: this._getDataID,
|
|
916
|
+
log: this._log,
|
|
906
917
|
path: [].concat((0, _toConsumableArray2["default"])(normalizationPath), [responseKey, String(itemIndex)]),
|
|
907
918
|
treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
|
|
908
919
|
shouldProcessClientComponents: this._shouldProcessClientComponents
|
|
@@ -14,13 +14,14 @@ var defaultGetDataID = require('./defaultGetDataID');
|
|
|
14
14
|
var defaultRelayFieldLogger = require('./defaultRelayFieldLogger');
|
|
15
15
|
var normalizeResponse = require('./normalizeResponse');
|
|
16
16
|
var OperationExecutor = require('./OperationExecutor');
|
|
17
|
+
var RelayModernStore = require('./RelayModernStore');
|
|
17
18
|
var RelayPublishQueue = require('./RelayPublishQueue');
|
|
18
19
|
var RelayRecordSource = require('./RelayRecordSource');
|
|
19
20
|
var invariant = require('invariant');
|
|
20
21
|
var RelayModernEnvironment = /*#__PURE__*/function () {
|
|
21
22
|
function RelayModernEnvironment(config) {
|
|
22
23
|
var _this = this;
|
|
23
|
-
var _config$log, _config$relayFieldLog, _config$UNSTABLE_defa, _config$getDataID, _config$missingFieldH, _config$handlerProvid, _config$scheduler, _config$isServer, _config$normalizeResp, _config$operationTrac;
|
|
24
|
+
var _config$store, _config$log, _config$relayFieldLog, _config$UNSTABLE_defa, _config$getDataID, _config$missingFieldH, _config$handlerProvid, _config$scheduler, _config$isServer, _config$normalizeResp, _config$operationTrac;
|
|
24
25
|
this.configName = config.configName;
|
|
25
26
|
this._treatMissingFieldsAsNull = config.treatMissingFieldsAsNull === true;
|
|
26
27
|
var operationLoader = config.operationLoader;
|
|
@@ -29,6 +30,12 @@ var RelayModernEnvironment = /*#__PURE__*/function () {
|
|
|
29
30
|
!(typeof operationLoader === 'object' && typeof operationLoader.get === 'function' && typeof operationLoader.load === 'function') ? process.env.NODE_ENV !== "production" ? invariant(false, 'RelayModernEnvironment: Expected `operationLoader` to be an object ' + 'with get() and load() functions, got `%s`.', operationLoader) : invariant(false) : void 0;
|
|
30
31
|
}
|
|
31
32
|
}
|
|
33
|
+
var store = (_config$store = config.store) !== null && _config$store !== void 0 ? _config$store : new RelayModernStore(new RelayRecordSource(), {
|
|
34
|
+
log: config.log,
|
|
35
|
+
operationLoader: config.operationLoader,
|
|
36
|
+
getDataID: config.getDataID,
|
|
37
|
+
shouldProcessClientComponents: config.shouldProcessClientComponents
|
|
38
|
+
});
|
|
32
39
|
this.__log = (_config$log = config.log) !== null && _config$log !== void 0 ? _config$log : emptyFunction;
|
|
33
40
|
this.relayFieldLogger = (_config$relayFieldLog = config.relayFieldLogger) !== null && _config$relayFieldLog !== void 0 ? _config$relayFieldLog : defaultRelayFieldLogger;
|
|
34
41
|
this._defaultRenderPolicy = (_config$UNSTABLE_defa = config.UNSTABLE_defaultRenderPolicy) !== null && _config$UNSTABLE_defa !== void 0 ? _config$UNSTABLE_defa : 'partial';
|
|
@@ -37,9 +44,9 @@ var RelayModernEnvironment = /*#__PURE__*/function () {
|
|
|
37
44
|
this._network = wrapNetworkWithLogObserver(this, config.network);
|
|
38
45
|
this._getDataID = (_config$getDataID = config.getDataID) !== null && _config$getDataID !== void 0 ? _config$getDataID : defaultGetDataID;
|
|
39
46
|
this._missingFieldHandlers = (_config$missingFieldH = config.missingFieldHandlers) !== null && _config$missingFieldH !== void 0 ? _config$missingFieldH : [];
|
|
40
|
-
this._publishQueue = new RelayPublishQueue(
|
|
47
|
+
this._publishQueue = new RelayPublishQueue(store, (_config$handlerProvid = config.handlerProvider) !== null && _config$handlerProvid !== void 0 ? _config$handlerProvid : RelayDefaultHandlerProvider, this._getDataID, this._missingFieldHandlers, this.__log);
|
|
41
48
|
this._scheduler = (_config$scheduler = config.scheduler) !== null && _config$scheduler !== void 0 ? _config$scheduler : null;
|
|
42
|
-
this._store =
|
|
49
|
+
this._store = store;
|
|
43
50
|
this.options = config.options;
|
|
44
51
|
this._isServer = (_config$isServer = config.isServer) !== null && _config$isServer !== void 0 ? _config$isServer : false;
|
|
45
52
|
this._normalizeResponse = (_config$normalizeResp = config.normalizeResponse) !== null && _config$normalizeResp !== void 0 ? _config$normalizeResp : normalizeResponse;
|
|
@@ -199,7 +206,9 @@ var RelayModernEnvironment = /*#__PURE__*/function () {
|
|
|
199
206
|
var operation = _ref.operation;
|
|
200
207
|
return this._execute({
|
|
201
208
|
createSource: function createSource() {
|
|
202
|
-
return _this7.getNetwork().execute(operation.request.node.params, operation.request.variables, operation.request.cacheConfig || {}, null)
|
|
209
|
+
return _this7.getNetwork().execute(operation.request.node.params, operation.request.variables, operation.request.cacheConfig || {}, null, undefined, undefined, undefined, function () {
|
|
210
|
+
return _this7.check(operation);
|
|
211
|
+
});
|
|
203
212
|
},
|
|
204
213
|
isClientPayload: false,
|
|
205
214
|
operation: operation,
|
|
@@ -132,14 +132,14 @@ var SelectorResolver = /*#__PURE__*/function () {
|
|
|
132
132
|
(0, _defineProperty2["default"])(this, "_onChange", function (snapshot) {
|
|
133
133
|
_this2._data = snapshot.data;
|
|
134
134
|
_this2._isMissingData = snapshot.isMissingData;
|
|
135
|
-
_this2.
|
|
135
|
+
_this2._fieldErrors = snapshot.fieldErrors;
|
|
136
136
|
_this2._callback();
|
|
137
137
|
});
|
|
138
138
|
var _snapshot = environment.lookup(selector);
|
|
139
139
|
this._callback = callback;
|
|
140
140
|
this._data = _snapshot.data;
|
|
141
141
|
this._isMissingData = _snapshot.isMissingData;
|
|
142
|
-
this.
|
|
142
|
+
this._fieldErrors = _snapshot.fieldErrors;
|
|
143
143
|
this._environment = environment;
|
|
144
144
|
this._rootIsQueryRenderer = rootIsQueryRenderer;
|
|
145
145
|
this._selector = selector;
|
|
@@ -182,7 +182,7 @@ var SelectorResolver = /*#__PURE__*/function () {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
handlePotentialSnapshotErrors(this._environment, this.
|
|
185
|
+
handlePotentialSnapshotErrors(this._environment, this._fieldErrors);
|
|
186
186
|
return this._data;
|
|
187
187
|
};
|
|
188
188
|
_proto2.setSelector = function setSelector(selector) {
|
|
@@ -193,7 +193,7 @@ var SelectorResolver = /*#__PURE__*/function () {
|
|
|
193
193
|
var snapshot = this._environment.lookup(selector);
|
|
194
194
|
this._data = recycleNodesInto(this._data, snapshot.data);
|
|
195
195
|
this._isMissingData = snapshot.isMissingData;
|
|
196
|
-
this.
|
|
196
|
+
this._fieldErrors = snapshot.fieldErrors;
|
|
197
197
|
this._selector = selector;
|
|
198
198
|
this._subscription = this._environment.subscribe(snapshot, this._onChange);
|
|
199
199
|
};
|
|
@@ -28,7 +28,7 @@ var DEFAULT_RELEASE_BUFFER_SIZE = 10;
|
|
|
28
28
|
var RelayModernStore = /*#__PURE__*/function () {
|
|
29
29
|
function RelayModernStore(source, options) {
|
|
30
30
|
var _this = this;
|
|
31
|
-
var _options$gcReleaseBuf, _options$gcScheduler, _options$getDataID, _options$log, _options$operationLoa, _options$shouldProces, _options$treatMissing;
|
|
31
|
+
var _options$gcReleaseBuf, _options$shouldRetain, _options$gcScheduler, _options$getDataID, _options$log, _options$operationLoa, _options$shouldProces, _options$treatMissing;
|
|
32
32
|
(0, _defineProperty2["default"])(this, "_gcStep", function () {
|
|
33
33
|
if (_this._gcRun) {
|
|
34
34
|
if (_this._gcRun.next().done) {
|
|
@@ -50,6 +50,7 @@ var RelayModernStore = /*#__PURE__*/function () {
|
|
|
50
50
|
this._currentWriteEpoch = 0;
|
|
51
51
|
this._gcHoldCounter = 0;
|
|
52
52
|
this._gcReleaseBufferSize = (_options$gcReleaseBuf = options === null || options === void 0 ? void 0 : options.gcReleaseBufferSize) !== null && _options$gcReleaseBuf !== void 0 ? _options$gcReleaseBuf : DEFAULT_RELEASE_BUFFER_SIZE;
|
|
53
|
+
this._shouldRetainWithinTTL_EXPERIMENTAL = (_options$shouldRetain = options === null || options === void 0 ? void 0 : options.shouldRetainWithinTTL_EXPERIMENTAL) !== null && _options$shouldRetain !== void 0 ? _options$shouldRetain : false;
|
|
53
54
|
this._gcRun = null;
|
|
54
55
|
this._gcScheduler = (_options$gcScheduler = options === null || options === void 0 ? void 0 : options.gcScheduler) !== null && _options$gcScheduler !== void 0 ? _options$gcScheduler : resolveImmediate;
|
|
55
56
|
this._getDataID = (_options$getDataID = options === null || options === void 0 ? void 0 : options.getDataID) !== null && _options$getDataID !== void 0 ? _options$getDataID : defaultGetDataID;
|
|
@@ -67,10 +68,10 @@ var RelayModernStore = /*#__PURE__*/function () {
|
|
|
67
68
|
this._resolverCache = new LiveResolverCache(function () {
|
|
68
69
|
return _this._getMutableRecordSource();
|
|
69
70
|
}, this);
|
|
70
|
-
this.
|
|
71
|
+
this._resolverContext = options === null || options === void 0 ? void 0 : options.resolverContext;
|
|
72
|
+
this._storeSubscriptions = new RelayStoreSubscriptions(options === null || options === void 0 ? void 0 : options.log, this._resolverCache, this._resolverContext);
|
|
71
73
|
this._updatedRecordIDs = new Set();
|
|
72
74
|
this._shouldProcessClientComponents = (_options$shouldProces = options === null || options === void 0 ? void 0 : options.shouldProcessClientComponents) !== null && _options$shouldProces !== void 0 ? _options$shouldProces : false;
|
|
73
|
-
this._resolverContext = options === null || options === void 0 ? void 0 : options.resolverContext;
|
|
74
75
|
this._treatMissingFieldsAsNull = (_options$treatMissing = options === null || options === void 0 ? void 0 : options.treatMissingFieldsAsNull) !== null && _options$treatMissing !== void 0 ? _options$treatMissing : false;
|
|
75
76
|
this._actorIdentifier = options === null || options === void 0 ? void 0 : options.actorIdentifier;
|
|
76
77
|
initializeRecordSource(this._recordSource);
|
|
@@ -150,13 +151,17 @@ var RelayModernStore = /*#__PURE__*/function () {
|
|
|
150
151
|
var _queryCacheExpirationTime = _this2._queryCacheExpirationTime;
|
|
151
152
|
var rootEntryIsStale = rootEntry.fetchTime != null && _queryCacheExpirationTime != null && rootEntry.fetchTime <= Date.now() - _queryCacheExpirationTime;
|
|
152
153
|
if (rootEntryIsStale) {
|
|
153
|
-
_this2.
|
|
154
|
+
if (!_this2._shouldRetainWithinTTL_EXPERIMENTAL) {
|
|
155
|
+
_this2._roots["delete"](id);
|
|
156
|
+
}
|
|
154
157
|
_this2.scheduleGC();
|
|
155
158
|
} else {
|
|
156
159
|
_this2._releaseBuffer.push(id);
|
|
157
160
|
if (_this2._releaseBuffer.length > _this2._gcReleaseBufferSize) {
|
|
158
161
|
var _id = _this2._releaseBuffer.shift();
|
|
159
|
-
_this2.
|
|
162
|
+
if (!_this2._shouldRetainWithinTTL_EXPERIMENTAL) {
|
|
163
|
+
_this2._roots["delete"](_id);
|
|
164
|
+
}
|
|
160
165
|
_this2.scheduleGC();
|
|
161
166
|
}
|
|
162
167
|
}
|
|
@@ -414,6 +419,9 @@ var RelayModernStore = /*#__PURE__*/function () {
|
|
|
414
419
|
while (!gcRun.next().done) {}
|
|
415
420
|
};
|
|
416
421
|
_proto._collect = function* _collect() {
|
|
422
|
+
if (this._shouldRetainWithinTTL_EXPERIMENTAL && this._queryCacheExpirationTime == null) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
417
425
|
var log = this.__log;
|
|
418
426
|
top: while (true) {
|
|
419
427
|
if (log != null) {
|
|
@@ -423,11 +431,25 @@ var RelayModernStore = /*#__PURE__*/function () {
|
|
|
423
431
|
}
|
|
424
432
|
var startEpoch = this._currentWriteEpoch;
|
|
425
433
|
var references = new Set();
|
|
426
|
-
var _iterator2 = (0, _createForOfIteratorHelper2["default"])(this._roots.
|
|
434
|
+
var _iterator2 = (0, _createForOfIteratorHelper2["default"])(this._roots.entries()),
|
|
427
435
|
_step2;
|
|
428
436
|
try {
|
|
429
437
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
430
|
-
var
|
|
438
|
+
var _step2$value = _step2.value,
|
|
439
|
+
_dataID = _step2$value[0],
|
|
440
|
+
_step2$value$ = _step2$value[1],
|
|
441
|
+
operation = _step2$value$.operation,
|
|
442
|
+
refCount = _step2$value$.refCount,
|
|
443
|
+
fetchTime = _step2$value$.fetchTime;
|
|
444
|
+
if (this._shouldRetainWithinTTL_EXPERIMENTAL) {
|
|
445
|
+
var _queryCacheExpirationTime = this._queryCacheExpirationTime;
|
|
446
|
+
!(_queryCacheExpirationTime != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'Query cache expiration time should be non-null if executing GC') : invariant(false) : void 0;
|
|
447
|
+
var recordHasExpired = fetchTime == null || fetchTime <= Date.now() - _queryCacheExpirationTime;
|
|
448
|
+
var recordShouldBeCollected = recordHasExpired && refCount === 0 && !this._releaseBuffer.includes(_dataID);
|
|
449
|
+
if (recordShouldBeCollected) {
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
431
453
|
var selector = operation.root;
|
|
432
454
|
RelayReferenceMarker.mark(this._recordSource, selector, references, this._operationLoader, this._shouldProcessClientComponents);
|
|
433
455
|
yield;
|
|
@@ -445,21 +467,20 @@ var RelayModernStore = /*#__PURE__*/function () {
|
|
|
445
467
|
} finally {
|
|
446
468
|
_iterator2.f();
|
|
447
469
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
var maybeResolverSubscription = RelayModernRecord.getValue(record, RELAY_RESOLVER_LIVE_STATE_SUBSCRIPTION_KEY);
|
|
458
|
-
if (maybeResolverSubscription != null) {
|
|
459
|
-
maybeResolverSubscription();
|
|
460
|
-
}
|
|
470
|
+
var storeIDs = this._recordSource.getRecordIDs();
|
|
471
|
+
for (var ii = 0; ii < storeIDs.length; ii++) {
|
|
472
|
+
var dataID = storeIDs[ii];
|
|
473
|
+
if (!references.has(dataID)) {
|
|
474
|
+
var record = this._recordSource.get(dataID);
|
|
475
|
+
if (record != null) {
|
|
476
|
+
var maybeResolverSubscription = RelayModernRecord.getValue(record, RELAY_RESOLVER_LIVE_STATE_SUBSCRIPTION_KEY);
|
|
477
|
+
if (maybeResolverSubscription != null) {
|
|
478
|
+
maybeResolverSubscription();
|
|
461
479
|
}
|
|
462
|
-
|
|
480
|
+
}
|
|
481
|
+
this._recordSource.remove(dataID);
|
|
482
|
+
if (this._shouldRetainWithinTTL_EXPERIMENTAL) {
|
|
483
|
+
this._roots["delete"](dataID);
|
|
463
484
|
}
|
|
464
485
|
}
|
|
465
486
|
}
|
|
@@ -476,6 +497,7 @@ var RelayModernStore = /*#__PURE__*/function () {
|
|
|
476
497
|
return {
|
|
477
498
|
path: path,
|
|
478
499
|
getDataID: this._getDataID,
|
|
500
|
+
log: this.__log,
|
|
479
501
|
treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
|
|
480
502
|
shouldProcessClientComponents: this._shouldProcessClientComponents,
|
|
481
503
|
actorIdentifier: this._actorIdentifier
|
|
@@ -4,6 +4,7 @@ var _global$ErrorUtils$ap, _global$ErrorUtils;
|
|
|
4
4
|
var RelayRecordSourceMutator = require('../mutations/RelayRecordSourceMutator');
|
|
5
5
|
var RelayRecordSourceProxy = require('../mutations/RelayRecordSourceProxy');
|
|
6
6
|
var RelayRecordSourceSelectorProxy = require('../mutations/RelayRecordSourceSelectorProxy');
|
|
7
|
+
var RelayFeatureFlags = require('../util/RelayFeatureFlags');
|
|
7
8
|
var RelayReader = require('./RelayReader');
|
|
8
9
|
var RelayRecordSource = require('./RelayRecordSource');
|
|
9
10
|
var invariant = require('invariant');
|
|
@@ -13,7 +14,7 @@ var applyWithGuard = (_global$ErrorUtils$ap = _global === null || _global === vo
|
|
|
13
14
|
return callback.apply(context, args);
|
|
14
15
|
};
|
|
15
16
|
var RelayPublishQueue = /*#__PURE__*/function () {
|
|
16
|
-
function RelayPublishQueue(store, handlerProvider, getDataID, missingFieldHandlers) {
|
|
17
|
+
function RelayPublishQueue(store, handlerProvider, getDataID, missingFieldHandlers, log) {
|
|
17
18
|
this._hasStoreSnapshot = false;
|
|
18
19
|
this._handlerProvider = handlerProvider || null;
|
|
19
20
|
this._pendingBackupRebase = false;
|
|
@@ -24,6 +25,7 @@ var RelayPublishQueue = /*#__PURE__*/function () {
|
|
|
24
25
|
this._gcHold = null;
|
|
25
26
|
this._getDataID = getDataID;
|
|
26
27
|
this._missingFieldHandlers = missingFieldHandlers;
|
|
28
|
+
this._log = log;
|
|
27
29
|
}
|
|
28
30
|
var _proto = RelayPublishQueue.prototype;
|
|
29
31
|
_proto.applyUpdate = function applyUpdate(updater) {
|
|
@@ -69,15 +71,11 @@ var RelayPublishQueue = /*#__PURE__*/function () {
|
|
|
69
71
|
_proto.run = function run(sourceOperation) {
|
|
70
72
|
var runWillClearGcHold = this._appliedOptimisticUpdates === 0 && !!this._gcHold;
|
|
71
73
|
var runIsANoop = !this._pendingBackupRebase && this._pendingOptimisticUpdates.size === 0 && !runWillClearGcHold;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this._isRunning = true;
|
|
76
|
-
}
|
|
74
|
+
process.env.NODE_ENV !== "production" ? warning(!runIsANoop, 'RelayPublishQueue.run was called, but the call would have been a noop.') : void 0;
|
|
75
|
+
RelayFeatureFlags.DISALLOW_NESTED_UPDATES ? !(this._isRunning !== true) ? process.env.NODE_ENV !== "production" ? invariant(false, 'A store update was detected within another store update. Please ' + "make sure new store updates aren't being executed within an " + 'updater function for a different update.') : invariant(false) : void 0 : process.env.NODE_ENV !== "production" ? warning(this._isRunning !== true, 'A store update was detected within another store update. Please ' + "make sure new store updates aren't being executed within an " + 'updater function for a different update.') : void 0;
|
|
76
|
+
this._isRunning = true;
|
|
77
77
|
if (runIsANoop) {
|
|
78
|
-
|
|
79
|
-
this._isRunning = false;
|
|
80
|
-
}
|
|
78
|
+
this._isRunning = false;
|
|
81
79
|
return [];
|
|
82
80
|
}
|
|
83
81
|
if (this._pendingBackupRebase) {
|
|
@@ -105,9 +103,7 @@ var RelayPublishQueue = /*#__PURE__*/function () {
|
|
|
105
103
|
this._gcHold = null;
|
|
106
104
|
}
|
|
107
105
|
}
|
|
108
|
-
|
|
109
|
-
this._isRunning = false;
|
|
110
|
-
}
|
|
106
|
+
this._isRunning = false;
|
|
111
107
|
return this._store.notify(sourceOperation, invalidatedStore);
|
|
112
108
|
};
|
|
113
109
|
_proto._publishSourceFromPayload = function _publishSourceFromPayload(pendingPayload) {
|
|
@@ -118,7 +114,7 @@ var RelayPublishQueue = /*#__PURE__*/function () {
|
|
|
118
114
|
var source = payload.source,
|
|
119
115
|
fieldPayloads = payload.fieldPayloads;
|
|
120
116
|
var mutator = new RelayRecordSourceMutator(this._store.getSource(), source);
|
|
121
|
-
var recordSourceProxy = new RelayRecordSourceProxy(mutator, this._getDataID, this._handlerProvider, this._missingFieldHandlers);
|
|
117
|
+
var recordSourceProxy = new RelayRecordSourceProxy(mutator, this._getDataID, this._handlerProvider, this._missingFieldHandlers, this._log);
|
|
122
118
|
if (fieldPayloads && fieldPayloads.length) {
|
|
123
119
|
fieldPayloads.forEach(function (fieldPayload) {
|
|
124
120
|
var handler = _this._handlerProvider && _this._handlerProvider(fieldPayload.handle);
|
|
@@ -154,7 +150,7 @@ var RelayPublishQueue = /*#__PURE__*/function () {
|
|
|
154
150
|
var updater = data.updater;
|
|
155
151
|
var sink = RelayRecordSource.create();
|
|
156
152
|
var mutator = new RelayRecordSourceMutator(_this2._store.getSource(), sink);
|
|
157
|
-
var recordSourceProxy = new RelayRecordSourceProxy(mutator, _this2._getDataID, _this2._handlerProvider, _this2._missingFieldHandlers);
|
|
153
|
+
var recordSourceProxy = new RelayRecordSourceProxy(mutator, _this2._getDataID, _this2._handlerProvider, _this2._missingFieldHandlers, _this2._log);
|
|
158
154
|
applyWithGuard(updater, null, [recordSourceProxy], null, 'RelayPublishQueue:commitData');
|
|
159
155
|
invalidatedStore = invalidatedStore || recordSourceProxy.isStoreMarkedForInvalidation();
|
|
160
156
|
var idsMarkedForInvalidation = recordSourceProxy.getIDsMarkedForInvalidation();
|
|
@@ -168,7 +164,7 @@ var RelayPublishQueue = /*#__PURE__*/function () {
|
|
|
168
164
|
var _this3 = this;
|
|
169
165
|
var sink = RelayRecordSource.create();
|
|
170
166
|
var mutator = new RelayRecordSourceMutator(this._store.getSource(), sink);
|
|
171
|
-
var recordSourceProxy = new RelayRecordSourceProxy(mutator, this._getDataID, this._handlerProvider, this._missingFieldHandlers);
|
|
167
|
+
var recordSourceProxy = new RelayRecordSourceProxy(mutator, this._getDataID, this._handlerProvider, this._missingFieldHandlers, this._log);
|
|
172
168
|
var processUpdate = function processUpdate(optimisticUpdate) {
|
|
173
169
|
if (optimisticUpdate.storeUpdater) {
|
|
174
170
|
var storeUpdater = optimisticUpdate.storeUpdater;
|