@apollo/client 3.12.3 → 3.12.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 3.12.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#12236](https://github.com/apollographql/apollo-client/pull/12236) [`4334d30`](https://github.com/apollographql/apollo-client/commit/4334d30cc3fbedb4f736eff196c49a9f20a46704) Thanks [@charpeni](https://github.com/charpeni)! - Fix an issue with `refetchQueries` where comparing `DocumentNode`s internally by references could lead to an unknown query, even though the `DocumentNode` was indeed an active query—with a different reference.
8
+
3
9
  ## 3.12.3
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -5,13 +5,13 @@
5
5
  </p>
6
6
  <h1>Apollo Client</h1>
7
7
 
8
- [![npm version](https://badge.fury.io/js/%40apollo%2Fclient.svg)](https://badge.fury.io/js/%40apollo%2Fclient) [![Build Status](https://circleci.com/gh/apollographql/apollo-client.svg?style=svg)](https://circleci.com/gh/apollographql/apollo-client) [![Join the community](https://img.shields.io/discourse/status?label=Join%20the%20community&server=https%3A%2F%2Fcommunity.apollographql.com)](https://community.apollographql.com) [![Join our Discord server](https://img.shields.io/discord/1022972389463687228.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square)](https://discord.gg/graphos)
8
+ [![npm version](https://badge.fury.io/js/%40apollo%2Fclient.svg)](https://badge.fury.io/js/%40apollo%2Fclient) [![Build Status](https://circleci.com/gh/apollographql/apollo-client.svg?style=svg)](https://circleci.com/gh/apollographql/apollo-client) [![Join the community](https://img.shields.io/discourse/status?label=Join%20the%20community&server=https%3A%2F%2Fcommunity.apollographql.com)](https://community.apollographql.com)
9
9
 
10
10
  </div>
11
11
 
12
12
  ---
13
13
 
14
- **Announcement:**
14
+ **Announcement:**
15
15
  Join 1000+ engineers at GraphQL Summit for talks, workshops, and office hours, Oct 8-10 in NYC. [Get your pass here ->](https://summit.graphql.com/?utm_campaign=github_federation_readme)
16
16
 
17
17
  ---
package/apollo-client.cjs CHANGED
@@ -31,7 +31,7 @@ function _interopNamespace(e) {
31
31
  var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
32
32
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
33
 
34
- var version = "3.12.3";
34
+ var version = "3.12.4";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -6486,15 +6486,19 @@ var QueryManager = (function () {
6486
6486
  var _this = this;
6487
6487
  if (include === void 0) { include = "active"; }
6488
6488
  var queries = new Map();
6489
- var queryNamesAndDocs = new Map();
6489
+ var queryNames = new Map();
6490
+ var queryNamesAndQueryStrings = new Map();
6490
6491
  var legacyQueryOptions = new Set();
6491
6492
  if (Array.isArray(include)) {
6492
6493
  include.forEach(function (desc) {
6493
6494
  if (typeof desc === "string") {
6494
- queryNamesAndDocs.set(desc, false);
6495
+ queryNames.set(desc, desc);
6496
+ queryNamesAndQueryStrings.set(desc, false);
6495
6497
  }
6496
6498
  else if (isDocumentNode(desc)) {
6497
- queryNamesAndDocs.set(_this.transform(desc), false);
6499
+ var queryString = print(_this.transform(desc));
6500
+ queryNames.set(queryString, getOperationName(desc));
6501
+ queryNamesAndQueryStrings.set(queryString, false);
6498
6502
  }
6499
6503
  else if (isNonNullObject(desc) && desc.query) {
6500
6504
  legacyQueryOptions.add(desc);
@@ -6514,13 +6518,13 @@ var QueryManager = (function () {
6514
6518
  return;
6515
6519
  }
6516
6520
  if (include === "active" ||
6517
- (queryName && queryNamesAndDocs.has(queryName)) ||
6518
- (document && queryNamesAndDocs.has(document))) {
6521
+ (queryName && queryNamesAndQueryStrings.has(queryName)) ||
6522
+ (document && queryNamesAndQueryStrings.has(print(document)))) {
6519
6523
  queries.set(queryId, oq);
6520
6524
  if (queryName)
6521
- queryNamesAndDocs.set(queryName, true);
6525
+ queryNamesAndQueryStrings.set(queryName, true);
6522
6526
  if (document)
6523
- queryNamesAndDocs.set(document, true);
6527
+ queryNamesAndQueryStrings.set(print(document), true);
6524
6528
  }
6525
6529
  }
6526
6530
  });
@@ -6541,10 +6545,16 @@ var QueryManager = (function () {
6541
6545
  queries.set(queryId, oq);
6542
6546
  });
6543
6547
  }
6544
- if (globalThis.__DEV__ !== false && queryNamesAndDocs.size) {
6545
- queryNamesAndDocs.forEach(function (included, nameOrDoc) {
6548
+ if (globalThis.__DEV__ !== false && queryNamesAndQueryStrings.size) {
6549
+ queryNamesAndQueryStrings.forEach(function (included, nameOrQueryString) {
6546
6550
  if (!included) {
6547
- globalThis.__DEV__ !== false && invariant.warn(typeof nameOrDoc === "string" ? 35 : 36, nameOrDoc);
6551
+ var queryName = queryNames.get(nameOrQueryString);
6552
+ if (queryName) {
6553
+ globalThis.__DEV__ !== false && invariant.warn(35, queryName);
6554
+ }
6555
+ else {
6556
+ globalThis.__DEV__ !== false && invariant.warn(36);
6557
+ }
6548
6558
  }
6549
6559
  });
6550
6560
  }