relay-runtime 0.0.0-main-9262f2ac → 0.0.0-main-668c9f2e
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/index.js +1 -1
- package/lib/store/RelayResponseNormalizer.js +5 -1
- package/multi-actor-environment/MultiActorEnvironment.js.flow +2 -6
- package/mutations/RelayDeclarativeMutationConfig.js.flow +3 -7
- package/mutations/commitMutation.js.flow +2 -8
- package/network/RelayObservable.js.flow +1 -1
- package/package.json +1 -1
- package/query/PreloadableQueryRegistry.js.flow +2 -1
- package/query/fetchQueryInternal.js.flow +2 -4
- package/relay-runtime.js +2 -2
- package/relay-runtime.min.js +1 -1
- package/store/DataChecker.js.flow +4 -10
- package/store/OperationExecutor.js.flow +15 -24
- package/store/RelayModernFragmentSpecResolver.js.flow +1 -1
- package/store/RelayOperationTracker.js.flow +9 -15
- package/store/RelayPublishQueue.js.flow +4 -2
- package/store/RelayReader.js.flow +8 -10
- package/store/RelayResponseNormalizer.js.flow +7 -2
- package/subscription/requestSubscription.js.flow +2 -8
- package/util/getPaginationMetadata.js.flow +2 -4
- package/util/getPaginationVariables.js.flow +2 -4
- package/util/getRefetchMetadata.js.flow +4 -5
package/index.js
CHANGED
|
@@ -421,7 +421,11 @@ var RelayResponseNormalizer = /*#__PURE__*/function () {
|
|
|
421
421
|
|
|
422
422
|
if (process.env.NODE_ENV !== "production") {
|
|
423
423
|
if (selection.kind === SCALAR_FIELD) {
|
|
424
|
-
this._validateConflictingFieldsWithIdenticalId(record, storageKey,
|
|
424
|
+
this._validateConflictingFieldsWithIdenticalId(record, storageKey, // When using `treatMissingFieldsAsNull` the conflicting validation raises a false positive
|
|
425
|
+
// because the value is set using `null` but validated using `fieldValue` which at this point
|
|
426
|
+
// will be `undefined`.
|
|
427
|
+
// Setting this to `null` matches the value that we actually set to the `fieldValue`.
|
|
428
|
+
null);
|
|
425
429
|
}
|
|
426
430
|
}
|
|
427
431
|
|
|
@@ -161,9 +161,7 @@ class MultiActorEnvironment implements IMultiActorEnvironment {
|
|
|
161
161
|
handlers: [],
|
|
162
162
|
defaultActorIdentifier: actorEnvironment.actorIdentifier,
|
|
163
163
|
getSourceForActor: actorIdentifier => {
|
|
164
|
-
return this.forActor(actorIdentifier)
|
|
165
|
-
.getStore()
|
|
166
|
-
.getSource();
|
|
164
|
+
return this.forActor(actorIdentifier).getStore().getSource();
|
|
167
165
|
},
|
|
168
166
|
getTargetForActor: () => {
|
|
169
167
|
return RelayRecordSource.create();
|
|
@@ -189,9 +187,7 @@ class MultiActorEnvironment implements IMultiActorEnvironment {
|
|
|
189
187
|
handlers,
|
|
190
188
|
defaultActorIdentifier: actorEnvironment.actorIdentifier,
|
|
191
189
|
getSourceForActor: actorIdentifier => {
|
|
192
|
-
return this.forActor(actorIdentifier)
|
|
193
|
-
.getStore()
|
|
194
|
-
.getSource();
|
|
190
|
+
return this.forActor(actorIdentifier).getStore().getSource();
|
|
195
191
|
},
|
|
196
192
|
getTargetForActor: actorIdentifier => {
|
|
197
193
|
let target = targets.get(actorIdentifier);
|
|
@@ -39,7 +39,7 @@ export type RangeOperation = $Values<typeof RangeOperations>;
|
|
|
39
39
|
|
|
40
40
|
type RangeBehaviorsFunction = (connectionArgs: {
|
|
41
41
|
[name: string]: $FlowFixMe,
|
|
42
|
-
|
|
42
|
+
...
|
|
43
43
|
}) => RangeOperation;
|
|
44
44
|
type RangeBehaviorsObject = {[key: string]: RangeOperation, ...};
|
|
45
45
|
export type RangeBehaviors = RangeBehaviorsFunction | RangeBehaviorsObject;
|
|
@@ -243,12 +243,8 @@ function rangeDelete(
|
|
|
243
243
|
config: RangeDeleteConfig,
|
|
244
244
|
request: ConcreteRequest,
|
|
245
245
|
): ?SelectorStoreUpdater<mixed> {
|
|
246
|
-
const {
|
|
247
|
-
|
|
248
|
-
connectionKeys,
|
|
249
|
-
pathToConnection,
|
|
250
|
-
deletedIDFieldName,
|
|
251
|
-
} = config;
|
|
246
|
+
const {parentID, connectionKeys, pathToConnection, deletedIDFieldName} =
|
|
247
|
+
config;
|
|
252
248
|
if (!parentID) {
|
|
253
249
|
warning(
|
|
254
250
|
false,
|
|
@@ -102,14 +102,8 @@ function commitMutation<TMutation: MutationParameters>(
|
|
|
102
102
|
throw new Error('commitMutation: Expected mutation to be of type request');
|
|
103
103
|
}
|
|
104
104
|
let {optimisticResponse, optimisticUpdater, updater} = config;
|
|
105
|
-
const {
|
|
106
|
-
|
|
107
|
-
cacheConfig,
|
|
108
|
-
onError,
|
|
109
|
-
onUnsubscribe,
|
|
110
|
-
variables,
|
|
111
|
-
uploadables,
|
|
112
|
-
} = config;
|
|
105
|
+
const {configs, cacheConfig, onError, onUnsubscribe, variables, uploadables} =
|
|
106
|
+
config;
|
|
113
107
|
const operation = createOperationDescriptor(
|
|
114
108
|
mutation,
|
|
115
109
|
variables,
|
|
@@ -223,7 +223,7 @@ class RelayObservable<+T> implements Subscribable<T> {
|
|
|
223
223
|
do(observer: Observer<T>): RelayObservable<T> {
|
|
224
224
|
return RelayObservable.create(sink => {
|
|
225
225
|
const both = (action: any) =>
|
|
226
|
-
function() {
|
|
226
|
+
function () {
|
|
227
227
|
try {
|
|
228
228
|
observer[action] && observer[action].apply(observer, arguments);
|
|
229
229
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -60,6 +60,7 @@ class PreloadableQueryRegistry {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
const preloadableQueryRegistry: PreloadableQueryRegistry =
|
|
63
|
+
const preloadableQueryRegistry: PreloadableQueryRegistry =
|
|
64
|
+
new PreloadableQueryRegistry();
|
|
64
65
|
|
|
65
66
|
module.exports = preloadableQueryRegistry;
|
|
@@ -306,10 +306,8 @@ function getObservableForActiveRequest(
|
|
|
306
306
|
function getRequestCache(
|
|
307
307
|
environment: IEnvironment,
|
|
308
308
|
): Map<RequestIdentifier, RequestCacheEntry> {
|
|
309
|
-
const cached: ?Map<
|
|
310
|
-
|
|
311
|
-
RequestCacheEntry,
|
|
312
|
-
> = requestCachesByEnvironment.get(environment);
|
|
309
|
+
const cached: ?Map<RequestIdentifier, RequestCacheEntry> =
|
|
310
|
+
requestCachesByEnvironment.get(environment);
|
|
313
311
|
if (cached != null) {
|
|
314
312
|
return cached;
|
|
315
313
|
}
|