@apollo/client 3.8.3 → 3.9.0-alpha.0

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 (75) hide show
  1. package/README.md +8 -6
  2. package/apollo-client.cjs +12 -7
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/config/jest/setup.js +10 -0
  6. package/config/jest/setup.js.map +1 -1
  7. package/core/QueryInfo.d.ts +1 -1
  8. package/core/QueryInfo.d.ts.map +1 -1
  9. package/core/QueryInfo.js +4 -4
  10. package/core/QueryInfo.js.map +1 -1
  11. package/core/QueryManager.d.ts +1 -1
  12. package/core/QueryManager.d.ts.map +1 -1
  13. package/core/QueryManager.js +1 -1
  14. package/core/QueryManager.js.map +1 -1
  15. package/core/core.cjs +6 -6
  16. package/core/core.cjs.map +1 -1
  17. package/core/core.cjs.native.js +6 -6
  18. package/dev/dev.cjs +7 -2
  19. package/dev/dev.cjs.map +1 -1
  20. package/dev/dev.cjs.native.js +7 -2
  21. package/package.json +30 -23
  22. package/testing/core/core.cjs +19 -2
  23. package/testing/core/core.cjs.map +1 -1
  24. package/testing/core/core.cjs.native.js +19 -2
  25. package/testing/core/mocking/mockLink.d.ts +5 -2
  26. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  27. package/testing/core/mocking/mockLink.js +19 -2
  28. package/testing/core/mocking/mockLink.js.map +1 -1
  29. package/testing/core/withConsoleSpy.d.ts.map +1 -1
  30. package/testing/core/withConsoleSpy.js.map +1 -1
  31. package/testing/internal/disposables/index.d.ts +3 -0
  32. package/testing/internal/disposables/index.d.ts.map +1 -0
  33. package/testing/internal/disposables/index.js +3 -0
  34. package/testing/internal/disposables/index.js.map +1 -0
  35. package/testing/internal/disposables/spyOnConsole.d.ts +10 -0
  36. package/testing/internal/disposables/spyOnConsole.d.ts.map +1 -0
  37. package/testing/internal/disposables/spyOnConsole.js +33 -0
  38. package/testing/internal/disposables/spyOnConsole.js.map +1 -0
  39. package/testing/internal/disposables/withCleanup.d.ts +3 -0
  40. package/testing/internal/disposables/withCleanup.d.ts.map +1 -0
  41. package/testing/internal/disposables/withCleanup.js +11 -0
  42. package/testing/internal/disposables/withCleanup.js.map +1 -0
  43. package/testing/internal/index.d.ts +3 -0
  44. package/testing/internal/index.d.ts.map +1 -0
  45. package/testing/internal/index.js +3 -0
  46. package/testing/internal/index.js.map +1 -0
  47. package/testing/internal/profile/Render.d.ts +140 -0
  48. package/testing/internal/profile/Render.d.ts.map +1 -0
  49. package/testing/internal/profile/Render.js +132 -0
  50. package/testing/internal/profile/Render.js.map +1 -0
  51. package/testing/internal/profile/index.d.ts +4 -0
  52. package/testing/internal/profile/index.d.ts.map +1 -0
  53. package/testing/internal/profile/index.js +2 -0
  54. package/testing/internal/profile/index.js.map +1 -0
  55. package/testing/internal/profile/profile.d.ts +55 -0
  56. package/testing/internal/profile/profile.d.ts.map +1 -0
  57. package/testing/internal/profile/profile.js +222 -0
  58. package/testing/internal/profile/profile.js.map +1 -0
  59. package/testing/internal/profile/traces.d.ts +3 -0
  60. package/testing/internal/profile/traces.d.ts.map +1 -0
  61. package/testing/internal/profile/traces.js +26 -0
  62. package/testing/internal/profile/traces.js.map +1 -0
  63. package/testing/matchers/ProfiledComponent.d.ts +8 -0
  64. package/testing/matchers/ProfiledComponent.d.ts.map +1 -0
  65. package/testing/matchers/ProfiledComponent.js +107 -0
  66. package/testing/matchers/ProfiledComponent.js.map +1 -0
  67. package/testing/matchers/index.js +3 -0
  68. package/testing/matchers/index.js.map +1 -1
  69. package/utilities/globals/globals.cjs +7 -2
  70. package/utilities/globals/globals.cjs.map +1 -1
  71. package/utilities/globals/globals.cjs.native.js +7 -2
  72. package/utilities/globals/invariantWrappers.d.ts.map +1 -1
  73. package/utilities/globals/invariantWrappers.js +6 -1
  74. package/utilities/globals/invariantWrappers.js.map +1 -1
  75. package/version.js +1 -1
package/README.md CHANGED
@@ -1,11 +1,13 @@
1
- # <a href="https://www.apollographql.com/"><img src="https://user-images.githubusercontent.com/841294/53402609-b97a2180-39ba-11e9-8100-812bab86357c.png" height="100" alt="Apollo Client"></a>
1
+ <div align="center">
2
2
 
3
- ## Apollo Client
3
+ <p>
4
+ <a href="https://www.apollographql.com/"><img src="https://raw.githubusercontent.com/apollographql/apollo-client-devtools/main/assets/apollo-wordmark.svg" height="100" alt="Apollo Client"></a>
5
+ </p>
6
+ <h1>Apollo Client</h1>
4
7
 
5
- [![npm version](https://badge.fury.io/js/%40apollo%2Fclient.svg)](https://badge.fury.io/js/%40apollo%2Fclient)
6
- [![Build Status](https://circleci.com/gh/apollographql/apollo-client.svg?style=svg)](https://circleci.com/gh/apollographql/apollo-client)
7
- [![Join the community](https://img.shields.io/discourse/status?label=Join%20the%20community&server=https%3A%2F%2Fcommunity.apollographql.com)](https://community.apollographql.com)
8
- [![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) [![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)
9
+
10
+ </div>
9
11
 
10
12
  Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI components that fetch data via GraphQL.
11
13
 
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.8.3";
34
+ var version = "3.9.0-alpha.0";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -70,7 +70,12 @@ function wrap(fn) {
70
70
  for (var _i = 1; _i < arguments.length; _i++) {
71
71
  args[_i - 1] = arguments[_i];
72
72
  }
73
- fn.apply(void 0, tslib.__spreadArray([typeof message === "number" ? getErrorMsg(message) : message], args, false));
73
+ if (typeof message === "number") {
74
+ fn(getErrorMsg(message, args));
75
+ }
76
+ else {
77
+ fn.apply(void 0, tslib.__spreadArray([message], args, false));
78
+ }
74
79
  };
75
80
  }
76
81
  var invariant = Object.assign(function invariant(condition, message) {
@@ -5703,6 +5708,7 @@ var QueryInfo = (function () {
5703
5708
  };
5704
5709
  QueryInfo.prototype.markResult = function (result, document, options, cacheWriteBehavior) {
5705
5710
  var _this = this;
5711
+ result = tslib.__assign({}, result);
5706
5712
  var merger = new DeepMerger();
5707
5713
  var graphQLErrors = isNonEmptyArray(result.errors)
5708
5714
  ? result.errors.slice(0)
@@ -5731,7 +5737,7 @@ var QueryInfo = (function () {
5731
5737
  overwrite: cacheWriteBehavior === 1,
5732
5738
  });
5733
5739
  _this.lastWrite = {
5734
- result: result,
5740
+ result: tslib.__assign({}, result),
5735
5741
  variables: options.variables,
5736
5742
  dmCount: destructiveMethodCounts.get(_this.cache),
5737
5743
  };
@@ -5748,15 +5754,14 @@ var QueryInfo = (function () {
5748
5754
  _this.updateWatch(options.variables);
5749
5755
  }
5750
5756
  _this.updateLastDiff(diff, diffOptions);
5751
- if (diff.complete) {
5752
- result.data = diff.result;
5753
- }
5757
+ result.data = diff.result;
5754
5758
  });
5755
5759
  }
5756
5760
  else {
5757
5761
  this.lastWrite = void 0;
5758
5762
  }
5759
5763
  }
5764
+ return result;
5760
5765
  };
5761
5766
  QueryInfo.prototype.markReady = function () {
5762
5767
  this.networkError = null;
@@ -6427,7 +6432,7 @@ var QueryManager = (function () {
6427
6432
  graphQLErrors: graphQLErrors,
6428
6433
  }));
6429
6434
  }
6430
- queryInfo.markResult(result, linkDocument, options, cacheWriteBehavior);
6435
+ result = queryInfo.markResult(result, linkDocument, options, cacheWriteBehavior);
6431
6436
  queryInfo.markReady();
6432
6437
  }
6433
6438
  var aqr = {