relay-runtime 0.0.0-main-5e3851fa → 0.0.0-main-08390b45

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v0.0.0-main-5e3851fa
2
+ * Relay v0.0.0-main-08390b45
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
5
5
  *
@@ -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, fieldValue);
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
- parentID,
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
- configs,
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "relay-runtime",
3
3
  "description": "A core runtime for building GraphQL-driven applications.",
4
- "version": "0.0.0-main-5e3851fa",
4
+ "version": "0.0.0-main-08390b45",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay"
@@ -60,6 +60,7 @@ class PreloadableQueryRegistry {
60
60
  }
61
61
  }
62
62
 
63
- const preloadableQueryRegistry: PreloadableQueryRegistry = new 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
- RequestIdentifier,
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
  }