relay-runtime 0.0.0-main-e8cbdbdf → 0.0.0-main-4f3d2d05
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/RelayReader.js +12 -13
- package/package.json +1 -1
- package/relay-runtime.js +2 -2
- package/relay-runtime.min.js +2 -2
- package/store/RelayReader.js.flow +19 -14
package/index.js
CHANGED
package/lib/store/RelayReader.js
CHANGED
|
@@ -142,13 +142,7 @@ var RelayReader = /*#__PURE__*/function () {
|
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
if (isDataExpectedToBePresent && abstractKey != null && record != null) {
|
|
145
|
-
var
|
|
146
|
-
|
|
147
|
-
var typeID = generateTypeID(_recordType);
|
|
148
|
-
|
|
149
|
-
var typeRecord = this._recordSource.get(typeID);
|
|
150
|
-
|
|
151
|
-
var implementsInterface = typeRecord != null ? RelayModernRecord.getValue(typeRecord, abstractKey) : null;
|
|
145
|
+
var implementsInterface = this._implementsInterface(record, abstractKey);
|
|
152
146
|
|
|
153
147
|
if (implementsInterface === false) {
|
|
154
148
|
// Type known to not implement the interface
|
|
@@ -340,13 +334,8 @@ var RelayReader = /*#__PURE__*/function () {
|
|
|
340
334
|
var parentIsMissingData = this._isMissingData;
|
|
341
335
|
var parentIsWithinUnmatchedTypeRefinement = this._isWithinUnmatchedTypeRefinement;
|
|
342
336
|
|
|
343
|
-
var
|
|
344
|
-
|
|
345
|
-
var typeID = generateTypeID(_typeName);
|
|
346
|
-
|
|
347
|
-
var typeRecord = this._recordSource.get(typeID);
|
|
337
|
+
var implementsInterface = this._implementsInterface(record, abstractKey);
|
|
348
338
|
|
|
349
|
-
var implementsInterface = typeRecord != null ? RelayModernRecord.getValue(typeRecord, abstractKey) : null;
|
|
350
339
|
this._isWithinUnmatchedTypeRefinement = parentIsWithinUnmatchedTypeRefinement || implementsInterface === false;
|
|
351
340
|
|
|
352
341
|
this._traverseSelections(selection.selections, record, data);
|
|
@@ -924,6 +913,16 @@ var RelayReader = /*#__PURE__*/function () {
|
|
|
924
913
|
};
|
|
925
914
|
};
|
|
926
915
|
|
|
916
|
+
_proto._implementsInterface = function _implementsInterface(record, abstractKey) {
|
|
917
|
+
var typeName = RelayModernRecord.getType(record);
|
|
918
|
+
|
|
919
|
+
var typeRecord = this._recordSource.get(generateTypeID(typeName));
|
|
920
|
+
|
|
921
|
+
var implementsInterface = typeRecord != null ? RelayModernRecord.getValue(typeRecord, abstractKey) : null; // $FlowFixMe Casting record value
|
|
922
|
+
|
|
923
|
+
return implementsInterface;
|
|
924
|
+
};
|
|
925
|
+
|
|
927
926
|
return RelayReader;
|
|
928
927
|
}();
|
|
929
928
|
|