@apollo/client 3.7.0 → 3.7.2

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.
Files changed (44) hide show
  1. package/README.md +5 -5
  2. package/apollo-client.cjs +10 -10
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/core/types/common.d.ts +3 -2
  6. package/cache/core/types/common.d.ts.map +1 -1
  7. package/cache/core/types/common.js.map +1 -1
  8. package/cache/index.d.ts +1 -1
  9. package/cache/index.d.ts.map +1 -1
  10. package/cache/index.js.map +1 -1
  11. package/core/ApolloClient.js +1 -1
  12. package/core/ApolloClient.js.map +1 -1
  13. package/core/ObservableQuery.d.ts +1 -1
  14. package/core/ObservableQuery.d.ts.map +1 -1
  15. package/core/ObservableQuery.js +5 -3
  16. package/core/ObservableQuery.js.map +1 -1
  17. package/core/QueryManager.d.ts.map +1 -1
  18. package/core/QueryManager.js +1 -2
  19. package/core/QueryManager.js.map +1 -1
  20. package/core/core.cjs +7 -6
  21. package/core/core.cjs.map +1 -1
  22. package/core/core.cjs.native.js +7 -6
  23. package/errors/errors.cjs +1 -0
  24. package/errors/errors.cjs.map +1 -1
  25. package/errors/errors.cjs.native.js +1 -0
  26. package/errors/index.d.ts +1 -0
  27. package/errors/index.d.ts.map +1 -1
  28. package/errors/index.js +1 -0
  29. package/errors/index.js.map +1 -1
  30. package/invariantErrorCodes.js +1 -1
  31. package/link/batch-http/batchHttpLink.js.map +1 -1
  32. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  33. package/link/persisted-queries/index.js.map +1 -1
  34. package/package.json +17 -16
  35. package/react/hooks/hooks.cjs +2 -4
  36. package/react/hooks/hooks.cjs.map +1 -1
  37. package/react/hooks/hooks.cjs.native.js +2 -4
  38. package/react/hooks/useFragment.d.ts.map +1 -1
  39. package/react/hooks/useFragment.js +2 -4
  40. package/react/hooks/useFragment.js.map +1 -1
  41. package/react/hooks/useMutation.d.ts +1 -1
  42. package/react/hooks/useMutation.d.ts.map +1 -1
  43. package/react/hooks/useMutation.js.map +1 -1
  44. package/version.js +1 -1
package/README.md CHANGED
@@ -19,7 +19,7 @@ The Apollo Client API reference can be found at: <br/>
19
19
  Learn how to use Apollo Client with self-paced hands-on training on Odyssey, Apollo's official learning platform: <br/>
20
20
  [https://odyssey.apollographql.com/](https://odyssey.apollographql.com/)
21
21
 
22
- ## Apollo Maintainers
22
+ ## Maintainers
23
23
 
24
24
  - [@benjamn](https://github.com/benjamn)
25
25
  - [@alessbell](https://github.com/alessbell)
@@ -33,10 +33,10 @@ Learn how to use Apollo Client with self-paced hands-on training on Odyssey, Apo
33
33
 
34
34
  [Apollo](https://apollographql.com/) builds open-source software and a graph platform to unify GraphQL across your apps and services. We help you ship faster with:
35
35
 
36
- * [Apollo Studio](https://www.apollographql.com/studio/develop/) – A free, end-to-end platform for managing your GraphQL lifecycle. Track your GraphQL schemas in a hosted registry to create a source of truth for everything in your graph. Studio provides an IDE (Apollo Explorer) so you can explore data, collaborate on queries, observe usage, and safely make schema changes.
37
- * [Apollo Federation](https://www.apollographql.com/apollo-federation) – The industry-standard open architecture for building a distributed graph. Use Apollo’s gateway to compose a unified graph from multiple subgraphs, determine a query plan, and route requests across your services.
38
- * [Apollo Client](https://www.apollographql.com/apollo-client/) – The most popular GraphQL client for the web. Apollo also builds and maintains [Apollo iOS](https://github.com/apollographql/apollo-ios) and [Apollo Android](https://github.com/apollographql/apollo-android).
39
- * [Apollo Server](https://www.apollographql.com/docs/apollo-server/) – A production-ready JavaScript GraphQL server that connects to any microservice, API, or database. Compatible with all popular JavaScript frameworks and deployable in serverless environments.
36
+ - [Apollo Studio](https://www.apollographql.com/studio/develop/) – A free, end-to-end platform for managing your GraphQL lifecycle. Track your GraphQL schemas in a hosted registry to create a source of truth for everything in your graph. Studio provides an IDE (Apollo Explorer) so you can explore data, collaborate on queries, observe usage, and safely make schema changes.
37
+ - [Apollo Federation](https://www.apollographql.com/apollo-federation) – The industry-standard open architecture for building a distributed graph. Use Apollo’s gateway to compose a unified graph from multiple subgraphs, determine a query plan, and route requests across your services.
38
+ - [Apollo Client](https://www.apollographql.com/apollo-client/) – The most popular GraphQL client for the web. Apollo also builds and maintains [Apollo iOS](https://github.com/apollographql/apollo-ios) and [Apollo Android](https://github.com/apollographql/apollo-android).
39
+ - [Apollo Server](https://www.apollographql.com/docs/apollo-server/) – A production-ready JavaScript GraphQL server that connects to any microservice, API, or database. Compatible with all popular JavaScript frameworks and deployable in serverless environments.
40
40
 
41
41
  ## Learn how to build with Apollo
42
42
 
package/apollo-client.cjs CHANGED
@@ -1300,7 +1300,7 @@ var concat = ApolloLink.concat;
1300
1300
 
1301
1301
  var execute = ApolloLink.execute;
1302
1302
 
1303
- var version = '3.7.0';
1303
+ var version = '3.7.2';
1304
1304
 
1305
1305
  function isNodeResponse(value) {
1306
1306
  return !!value.body;
@@ -4201,6 +4201,7 @@ var ApolloError = (function (_super) {
4201
4201
  function ApolloError(_a) {
4202
4202
  var graphQLErrors = _a.graphQLErrors, clientErrors = _a.clientErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo;
4203
4203
  var _this = _super.call(this, errorMessage) || this;
4204
+ _this.name = 'ApolloError';
4204
4205
  _this.graphQLErrors = graphQLErrors || [];
4205
4206
  _this.clientErrors = clientErrors || [];
4206
4207
  _this.networkError = networkError || null;
@@ -4350,8 +4351,10 @@ var ObservableQuery = (function (_super) {
4350
4351
  }
4351
4352
  return result;
4352
4353
  };
4353
- ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) {
4354
- return !this.last || !equality.equal(this.last.result, newResult);
4354
+ ObservableQuery.prototype.isDifferentFromLastResult = function (newResult, variables) {
4355
+ return (!this.last ||
4356
+ !equality.equal(this.last.result, newResult) ||
4357
+ (variables && !equality.equal(this.last.variables, variables)));
4355
4358
  };
4356
4359
  ObservableQuery.prototype.getLast = function (key, variablesMustMatch) {
4357
4360
  var last = this.last;
@@ -4659,7 +4662,7 @@ var ObservableQuery = (function (_super) {
4659
4662
  };
4660
4663
  ObservableQuery.prototype.reportResult = function (result, variables) {
4661
4664
  var lastError = this.getLastError();
4662
- if (lastError || this.isDifferentFromLastResult(result)) {
4665
+ if (lastError || this.isDifferentFromLastResult(result, variables)) {
4663
4666
  if (lastError || !result.partial || this.options.returnPartialData) {
4664
4667
  this.updateLastResult(result, variables);
4665
4668
  }
@@ -5848,7 +5851,6 @@ var QueryManager = (function () {
5848
5851
  };
5849
5852
  QueryManager.prototype.getResultsFromLink = function (queryInfo, cacheWriteBehavior, options) {
5850
5853
  var requestId = queryInfo.lastRequestId = this.generateRequestId();
5851
- options = cloneDeep(options);
5852
5854
  var linkDocument = this.cache.transformForLink(this.transform(queryInfo.document).document);
5853
5855
  return asyncMap(this.getObservableFromLink(linkDocument, options.context, options.variables), function (result) {
5854
5856
  var graphQLErrors = isNonEmptyArray(result.errors)
@@ -6147,7 +6149,7 @@ var ApolloClient = (function () {
6147
6149
  if (connectToDevTools && typeof window === 'object') {
6148
6150
  window.__APOLLO_CLIENT__ = this;
6149
6151
  }
6150
- if (!hasSuggestedDevtools && __DEV__) {
6152
+ if (!hasSuggestedDevtools && connectToDevTools && __DEV__) {
6151
6153
  hasSuggestedDevtools = true;
6152
6154
  if (typeof window !== 'undefined' &&
6153
6155
  window.document &&
@@ -7104,13 +7106,11 @@ function useFragment_experimental(options) {
7104
7106
  var resultRef = React.useRef();
7105
7107
  var latestDiff = cache.diff(diffOptions);
7106
7108
  return useSyncExternalStore(function (forceUpdate) {
7107
- var immediate = true;
7108
- return cache.watch(tslib.__assign(tslib.__assign({}, diffOptions), { immediate: immediate, callback: function (diff) {
7109
- if (!immediate && !equality.equal(diff, latestDiff)) {
7109
+ return cache.watch(tslib.__assign(tslib.__assign({}, diffOptions), { immediate: true, callback: function (diff) {
7110
+ if (!equality.equal(diff, latestDiff)) {
7110
7111
  resultRef.current = diffToResult(latestDiff = diff);
7111
7112
  forceUpdate();
7112
7113
  }
7113
- immediate = false;
7114
7114
  } }));
7115
7115
  }, function () {
7116
7116
  var latestDiffToResult = diffToResult(latestDiff);