relay-runtime 20.1.0 → 20.1.1

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v20.1.0
2
+ * Relay v20.1.1
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Relay v20.1.0
2
+ * Relay v20.1.1
3
3
  *
4
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
5
  *
@@ -139,7 +139,7 @@ var RelayResponseNormalizer = /*#__PURE__*/function () {
139
139
  this._traverseSelections(selection, record, data);
140
140
  }
141
141
  } else {
142
- var implementsInterface = data.hasOwnProperty(abstractKey);
142
+ var implementsInterface = Object.prototype.hasOwnProperty.call(data, abstractKey);
143
143
  var _typeName = RelayModernRecord.getType(record);
144
144
  var typeID = generateTypeID(_typeName);
145
145
  var typeRecord = this._recordSource.get(typeID);
@@ -157,7 +157,7 @@ var RelayResponseNormalizer = /*#__PURE__*/function () {
157
157
  case 'TypeDiscriminator':
158
158
  {
159
159
  var _abstractKey = selection.abstractKey;
160
- var _implementsInterface = data.hasOwnProperty(_abstractKey);
160
+ var _implementsInterface = Object.prototype.hasOwnProperty.call(data, _abstractKey);
161
161
  var _typeName2 = RelayModernRecord.getType(record);
162
162
  var _typeID = generateTypeID(_typeName2);
163
163
  var _typeRecord = this._recordSource.get(_typeID);
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": "20.1.0",
4
+ "version": "20.1.1",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay"
@@ -443,7 +443,7 @@ function merge(record1: Record, record2: Record): Record {
443
443
  if (ERRORS_KEY in record1 || ERRORS_KEY in record2) {
444
444
  const {[ERRORS_KEY]: errors1, ...fields1} = record1;
445
445
  const {[ERRORS_KEY]: errors2, ...fields2} = record2;
446
- // $FlowIssue[cannot-spread-indexer]
446
+ // $FlowFixMe[cannot-spread-indexer]
447
447
  const updated: Record = {...fields1, ...fields2};
448
448
  if (errors1 == null && errors2 == null) {
449
449
  return updated;
@@ -465,7 +465,7 @@ function merge(record1: Record, record2: Record): Record {
465
465
  }
466
466
  return updated;
467
467
  } else {
468
- // $FlowIssue[cannot-spread-indexer]
468
+ // $FlowFixMe[cannot-spread-indexer]
469
469
  return {...record1, ...record2};
470
470
  }
471
471
  }
@@ -252,7 +252,7 @@ class RelayReader {
252
252
  const owner = this._fragmentName;
253
253
 
254
254
  this._fieldErrors.push(
255
- this._selector.node.metadata?.throwOnFieldError ?? false
255
+ (this._selector.node.metadata?.throwOnFieldError ?? false)
256
256
  ? {
257
257
  kind: 'missing_expected_data.throw',
258
258
  owner,
@@ -250,7 +250,11 @@ class RelayResponseNormalizer {
250
250
  this._traverseSelections(selection, record, data);
251
251
  }
252
252
  } else {
253
- const implementsInterface = data.hasOwnProperty(abstractKey);
253
+ // $FlowFixMe[method-unbinding] - data could be prototype less
254
+ const implementsInterface = Object.prototype.hasOwnProperty.call(
255
+ data,
256
+ abstractKey,
257
+ );
254
258
  const typeName = RelayModernRecord.getType(record);
255
259
  const typeID = generateTypeID(typeName);
256
260
  let typeRecord = this._recordSource.get(typeID);
@@ -271,7 +275,11 @@ class RelayResponseNormalizer {
271
275
  }
272
276
  case 'TypeDiscriminator': {
273
277
  const {abstractKey} = selection;
274
- const implementsInterface = data.hasOwnProperty(abstractKey);
278
+ // $FlowFixMe[method-unbinding] - data could be prototype less
279
+ const implementsInterface = Object.prototype.hasOwnProperty.call(
280
+ data,
281
+ abstractKey,
282
+ );
275
283
  const typeName = RelayModernRecord.getType(record);
276
284
  const typeID = generateTypeID(typeName);
277
285
  let typeRecord = this._recordSource.get(typeID);