relay-runtime 0.0.0-main-e5edd3f4 → 0.0.0-main-73d0780b
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
package/lib/store/DataChecker.js
CHANGED
|
@@ -670,7 +670,9 @@ var DataChecker = /*#__PURE__*/function () {
|
|
|
670
670
|
this._mutator.create(typeID, TYPE_SCHEMA_TYPE);
|
|
671
671
|
}
|
|
672
672
|
|
|
673
|
-
this._mutator.
|
|
673
|
+
if (this._mutator.getValue(typeID, abstractType) == null) {
|
|
674
|
+
this._mutator.setValue(typeID, abstractType, true);
|
|
675
|
+
}
|
|
674
676
|
}
|
|
675
677
|
} catch (err) {
|
|
676
678
|
_iterator5.e(err);
|
|
@@ -46,7 +46,7 @@ var RelayModernEnvironment = /*#__PURE__*/function () {
|
|
|
46
46
|
function RelayModernEnvironment(config) {
|
|
47
47
|
var _this = this;
|
|
48
48
|
|
|
49
|
-
var _config$log, _config$requiredField, _config$UNSTABLE_defa, _config$getDataID, _config$handlerProvid, _config$scheduler, _config$isServer, _config$operationTrac;
|
|
49
|
+
var _config$log, _config$requiredField, _config$UNSTABLE_defa, _config$getDataID, _config$handlerProvid, _config$scheduler, _config$isServer, _config$missingFieldH, _config$operationTrac;
|
|
50
50
|
|
|
51
51
|
this.configName = config.configName;
|
|
52
52
|
this._treatMissingFieldsAsNull = config.treatMissingFieldsAsNull === true;
|
|
@@ -90,7 +90,7 @@ var RelayModernEnvironment = /*#__PURE__*/function () {
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
this._missingFieldHandlers = config.missingFieldHandlers;
|
|
93
|
+
this._missingFieldHandlers = (_config$missingFieldH = config.missingFieldHandlers) !== null && _config$missingFieldH !== void 0 ? _config$missingFieldH : [];
|
|
94
94
|
this._operationTracker = (_config$operationTrac = config.operationTracker) !== null && _config$operationTrac !== void 0 ? _config$operationTrac : new RelayOperationTracker();
|
|
95
95
|
this._reactFlightPayloadDeserializer = reactFlightPayloadDeserializer;
|
|
96
96
|
this._reactFlightServerErrorHandler = reactFlightServerErrorHandler;
|
|
@@ -187,7 +187,7 @@ var RelayModernEnvironment = /*#__PURE__*/function () {
|
|
|
187
187
|
};
|
|
188
188
|
|
|
189
189
|
_proto.check = function check(operation) {
|
|
190
|
-
if (this._missingFieldHandlers
|
|
190
|
+
if (this._missingFieldHandlers.length === 0 && !operationHasClientAbstractTypes(operation)) {
|
|
191
191
|
return this._store.check(operation);
|
|
192
192
|
}
|
|
193
193
|
|
|
@@ -443,7 +443,11 @@ var RelayModernEnvironment = /*#__PURE__*/function () {
|
|
|
443
443
|
};
|
|
444
444
|
|
|
445
445
|
return RelayModernEnvironment;
|
|
446
|
-
}();
|
|
446
|
+
}();
|
|
447
|
+
|
|
448
|
+
function operationHasClientAbstractTypes(operation) {
|
|
449
|
+
return operation.root.node.kind === 'Operation' && operation.root.node.clientAbstractTypes != null;
|
|
450
|
+
} // Add a sigil for detection by `isRelayModernEnvironment()` to avoid a
|
|
447
451
|
// realm-specific instanceof check, and to aid in module tree-shaking to
|
|
448
452
|
// avoid requiring all of RelayRuntime just to detect its environment.
|
|
449
453
|
|