@apollo/client 3.8.2 → 3.8.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/README.md +8 -6
- package/apollo-client.cjs +46 -37
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/config/jest/setup.js +10 -0
- package/config/jest/setup.js.map +1 -1
- package/core/ApolloClient.d.ts +1 -0
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js +39 -35
- package/core/ApolloClient.js.map +1 -1
- package/core/QueryManager.d.ts +1 -1
- package/core/QueryManager.d.ts.map +1 -1
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +40 -36
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +40 -36
- package/dev/dev.cjs +7 -2
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +7 -2
- package/package.json +30 -23
- package/testing/core/withConsoleSpy.d.ts.map +1 -1
- package/testing/core/withConsoleSpy.js.map +1 -1
- package/testing/internal/disposables/index.d.ts +3 -0
- package/testing/internal/disposables/index.d.ts.map +1 -0
- package/testing/internal/disposables/index.js +3 -0
- package/testing/internal/disposables/index.js.map +1 -0
- package/testing/internal/disposables/spyOnConsole.d.ts +10 -0
- package/testing/internal/disposables/spyOnConsole.d.ts.map +1 -0
- package/testing/internal/disposables/spyOnConsole.js +33 -0
- package/testing/internal/disposables/spyOnConsole.js.map +1 -0
- package/testing/internal/disposables/withCleanup.d.ts +3 -0
- package/testing/internal/disposables/withCleanup.d.ts.map +1 -0
- package/testing/internal/disposables/withCleanup.js +11 -0
- package/testing/internal/disposables/withCleanup.js.map +1 -0
- package/testing/internal/index.d.ts +3 -0
- package/testing/internal/index.d.ts.map +1 -0
- package/testing/internal/index.js +3 -0
- package/testing/internal/index.js.map +1 -0
- package/testing/internal/profile/Render.d.ts +140 -0
- package/testing/internal/profile/Render.d.ts.map +1 -0
- package/testing/internal/profile/Render.js +132 -0
- package/testing/internal/profile/Render.js.map +1 -0
- package/testing/internal/profile/index.d.ts +4 -0
- package/testing/internal/profile/index.d.ts.map +1 -0
- package/testing/internal/profile/index.js +2 -0
- package/testing/internal/profile/index.js.map +1 -0
- package/testing/internal/profile/profile.d.ts +55 -0
- package/testing/internal/profile/profile.d.ts.map +1 -0
- package/testing/internal/profile/profile.js +222 -0
- package/testing/internal/profile/profile.js.map +1 -0
- package/testing/internal/profile/traces.d.ts +3 -0
- package/testing/internal/profile/traces.d.ts.map +1 -0
- package/testing/internal/profile/traces.js +26 -0
- package/testing/internal/profile/traces.js.map +1 -0
- package/testing/matchers/ProfiledComponent.d.ts +8 -0
- package/testing/matchers/ProfiledComponent.d.ts.map +1 -0
- package/testing/matchers/ProfiledComponent.js +107 -0
- package/testing/matchers/ProfiledComponent.js.map +1 -0
- package/testing/matchers/index.js +3 -0
- package/testing/matchers/index.js.map +1 -1
- package/utilities/globals/globals.cjs +7 -2
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +7 -2
- package/utilities/globals/invariantWrappers.d.ts.map +1 -1
- package/utilities/globals/invariantWrappers.js +6 -1
- package/utilities/globals/invariantWrappers.js.map +1 -1
- package/version.js +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
[](https://badge.fury.io/js/%40apollo%2Fclient)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[](https://discord.gg/graphos)
|
|
8
|
+
[](https://badge.fury.io/js/%40apollo%2Fclient) [](https://circleci.com/gh/apollographql/apollo-client) [](https://community.apollographql.com) [](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.
|
|
34
|
+
var version = "3.8.4";
|
|
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
|
-
|
|
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) {
|
|
@@ -6724,41 +6729,6 @@ var ApolloClient = (function () {
|
|
|
6724
6729
|
this.mutate = this.mutate.bind(this);
|
|
6725
6730
|
this.resetStore = this.resetStore.bind(this);
|
|
6726
6731
|
this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);
|
|
6727
|
-
if (connectToDevTools && typeof window === "object") {
|
|
6728
|
-
var windowWithDevTools = window;
|
|
6729
|
-
var devtoolsSymbol = Symbol.for("apollo.devtools");
|
|
6730
|
-
(windowWithDevTools[devtoolsSymbol] =
|
|
6731
|
-
windowWithDevTools[devtoolsSymbol] || []).push(this);
|
|
6732
|
-
windowWithDevTools.__APOLLO_CLIENT__ = this;
|
|
6733
|
-
}
|
|
6734
|
-
if (!hasSuggestedDevtools && connectToDevTools && globalThis.__DEV__ !== false) {
|
|
6735
|
-
hasSuggestedDevtools = true;
|
|
6736
|
-
setTimeout(function () {
|
|
6737
|
-
if (typeof window !== "undefined" &&
|
|
6738
|
-
window.document &&
|
|
6739
|
-
window.top === window.self &&
|
|
6740
|
-
!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__) {
|
|
6741
|
-
var nav = window.navigator;
|
|
6742
|
-
var ua = nav && nav.userAgent;
|
|
6743
|
-
var url = void 0;
|
|
6744
|
-
if (typeof ua === "string") {
|
|
6745
|
-
if (ua.indexOf("Chrome/") > -1) {
|
|
6746
|
-
url =
|
|
6747
|
-
"https://chrome.google.com/webstore/detail/" +
|
|
6748
|
-
"apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm";
|
|
6749
|
-
}
|
|
6750
|
-
else if (ua.indexOf("Firefox/") > -1) {
|
|
6751
|
-
url =
|
|
6752
|
-
"https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/";
|
|
6753
|
-
}
|
|
6754
|
-
}
|
|
6755
|
-
if (url) {
|
|
6756
|
-
globalThis.__DEV__ !== false && invariant.log("Download the Apollo DevTools for a better development " +
|
|
6757
|
-
"experience: %s", url);
|
|
6758
|
-
}
|
|
6759
|
-
}
|
|
6760
|
-
}, 10000);
|
|
6761
|
-
}
|
|
6762
6732
|
this.version = version;
|
|
6763
6733
|
this.localState = new LocalState({
|
|
6764
6734
|
cache: cache,
|
|
@@ -6794,7 +6764,46 @@ var ApolloClient = (function () {
|
|
|
6794
6764
|
}
|
|
6795
6765
|
: void 0,
|
|
6796
6766
|
});
|
|
6767
|
+
if (connectToDevTools)
|
|
6768
|
+
this.connectToDevTools();
|
|
6797
6769
|
}
|
|
6770
|
+
ApolloClient.prototype.connectToDevTools = function () {
|
|
6771
|
+
if (typeof window === "object") {
|
|
6772
|
+
var windowWithDevTools = window;
|
|
6773
|
+
var devtoolsSymbol = Symbol.for("apollo.devtools");
|
|
6774
|
+
(windowWithDevTools[devtoolsSymbol] =
|
|
6775
|
+
windowWithDevTools[devtoolsSymbol] || []).push(this);
|
|
6776
|
+
windowWithDevTools.__APOLLO_CLIENT__ = this;
|
|
6777
|
+
}
|
|
6778
|
+
if (!hasSuggestedDevtools && globalThis.__DEV__ !== false) {
|
|
6779
|
+
hasSuggestedDevtools = true;
|
|
6780
|
+
setTimeout(function () {
|
|
6781
|
+
if (typeof window !== "undefined" &&
|
|
6782
|
+
window.document &&
|
|
6783
|
+
window.top === window.self &&
|
|
6784
|
+
!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__) {
|
|
6785
|
+
var nav = window.navigator;
|
|
6786
|
+
var ua = nav && nav.userAgent;
|
|
6787
|
+
var url = void 0;
|
|
6788
|
+
if (typeof ua === "string") {
|
|
6789
|
+
if (ua.indexOf("Chrome/") > -1) {
|
|
6790
|
+
url =
|
|
6791
|
+
"https://chrome.google.com/webstore/detail/" +
|
|
6792
|
+
"apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm";
|
|
6793
|
+
}
|
|
6794
|
+
else if (ua.indexOf("Firefox/") > -1) {
|
|
6795
|
+
url =
|
|
6796
|
+
"https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/";
|
|
6797
|
+
}
|
|
6798
|
+
}
|
|
6799
|
+
if (url) {
|
|
6800
|
+
globalThis.__DEV__ !== false && invariant.log("Download the Apollo DevTools for a better development " +
|
|
6801
|
+
"experience: %s", url);
|
|
6802
|
+
}
|
|
6803
|
+
}
|
|
6804
|
+
}, 10000);
|
|
6805
|
+
}
|
|
6806
|
+
};
|
|
6798
6807
|
Object.defineProperty(ApolloClient.prototype, "documentTransform", {
|
|
6799
6808
|
get: function () {
|
|
6800
6809
|
return this.queryManager.documentTransform;
|