@apollo/client 3.5.0-rc.0 → 3.5.0-rc.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/apollo-client.cjs CHANGED
@@ -1291,7 +1291,7 @@ var concat = ApolloLink.concat;
1291
1291
 
1292
1292
  var execute = ApolloLink.execute;
1293
1293
 
1294
- var version = '3.5.0-rc.0';
1294
+ var version = '3.5.0-rc.1';
1295
1295
 
1296
1296
  var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
1297
1297
  function parseAndCheckHttpResponse(operations) {
@@ -5141,7 +5141,10 @@ var QueryManager = (function () {
5141
5141
  if (queryInfo)
5142
5142
  queryInfo.stop();
5143
5143
  };
5144
- QueryManager.prototype.clearStore = function () {
5144
+ QueryManager.prototype.clearStore = function (options) {
5145
+ if (options === void 0) { options = {
5146
+ discardWatches: true,
5147
+ }; }
5145
5148
  this.cancelPendingFetches(__DEV__ ? new tsInvariant.InvariantError('Store reset while query was in flight (not completed in link chain)') : new tsInvariant.InvariantError(18));
5146
5149
  this.queries.forEach(function (queryInfo) {
5147
5150
  if (queryInfo.observableQuery) {
@@ -5154,13 +5157,7 @@ var QueryManager = (function () {
5154
5157
  if (this.mutationStore) {
5155
5158
  this.mutationStore = Object.create(null);
5156
5159
  }
5157
- return this.cache.reset();
5158
- };
5159
- QueryManager.prototype.resetStore = function () {
5160
- var _this = this;
5161
- return this.clearStore().then(function () {
5162
- return _this.reFetchObservableQueries();
5163
- });
5160
+ return this.cache.reset(options);
5164
5161
  };
5165
5162
  QueryManager.prototype.getObservableQueries = function (include) {
5166
5163
  var _this = this;
@@ -5772,14 +5769,18 @@ var ApolloClient = (function () {
5772
5769
  ApolloClient.prototype.resetStore = function () {
5773
5770
  var _this = this;
5774
5771
  return Promise.resolve()
5775
- .then(function () { return _this.queryManager.clearStore(); })
5772
+ .then(function () { return _this.queryManager.clearStore({
5773
+ discardWatches: false,
5774
+ }); })
5776
5775
  .then(function () { return Promise.all(_this.resetStoreCallbacks.map(function (fn) { return fn(); })); })
5777
5776
  .then(function () { return _this.reFetchObservableQueries(); });
5778
5777
  };
5779
5778
  ApolloClient.prototype.clearStore = function () {
5780
5779
  var _this = this;
5781
5780
  return Promise.resolve()
5782
- .then(function () { return _this.queryManager.clearStore(); })
5781
+ .then(function () { return _this.queryManager.clearStore({
5782
+ discardWatches: true,
5783
+ }); })
5783
5784
  .then(function () { return Promise.all(_this.clearStoreCallbacks.map(function (fn) { return fn(); })); });
5784
5785
  };
5785
5786
  ApolloClient.prototype.onResetStore = function (cb) {