@apollo/client 3.8.0-alpha.3 → 3.8.0-alpha.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/apollo-client.cjs +11 -5
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/core/core.cjs +1 -1
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +1 -1
- package/invariantErrorCodes.js +1 -1
- package/package.json +12 -9
- package/react/hooks/hooks.cjs +10 -4
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +10 -4
- package/react/hooks/useQuery.d.ts +1 -0
- package/react/hooks/useQuery.d.ts.map +1 -1
- package/react/hooks/useQuery.js +8 -2
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/testing/core/core.cjs +17 -0
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +17 -0
- package/testing/core/index.d.ts +1 -0
- package/testing/core/index.d.ts.map +1 -1
- package/testing/core/index.js +1 -0
- package/testing/core/index.js.map +1 -1
- package/testing/core/wait.d.ts +3 -0
- package/testing/core/wait.d.ts.map +1 -0
- package/testing/core/wait.js +16 -0
- package/testing/core/wait.js.map +1 -0
- package/version.js +1 -1
package/apollo-client.cjs
CHANGED
|
@@ -1345,7 +1345,7 @@ var concat = ApolloLink.concat;
|
|
|
1345
1345
|
|
|
1346
1346
|
var execute = ApolloLink.execute;
|
|
1347
1347
|
|
|
1348
|
-
var version = '3.8.0-alpha.
|
|
1348
|
+
var version = '3.8.0-alpha.4';
|
|
1349
1349
|
|
|
1350
1350
|
function isNodeResponse(value) {
|
|
1351
1351
|
return !!value.body;
|
|
@@ -6833,9 +6833,10 @@ var InternalState = (function () {
|
|
|
6833
6833
|
InternalState.prototype.handleErrorOrCompleted = function (result, previousResult) {
|
|
6834
6834
|
var _this = this;
|
|
6835
6835
|
if (!result.loading) {
|
|
6836
|
+
var error_1 = this.toApolloError(result);
|
|
6836
6837
|
Promise.resolve().then(function () {
|
|
6837
|
-
if (
|
|
6838
|
-
_this.onError(
|
|
6838
|
+
if (error_1) {
|
|
6839
|
+
_this.onError(error_1);
|
|
6839
6840
|
}
|
|
6840
6841
|
else if (result.data &&
|
|
6841
6842
|
(previousResult === null || previousResult === void 0 ? void 0 : previousResult.networkStatus) !== result.networkStatus &&
|
|
@@ -6847,6 +6848,11 @@ var InternalState = (function () {
|
|
|
6847
6848
|
});
|
|
6848
6849
|
}
|
|
6849
6850
|
};
|
|
6851
|
+
InternalState.prototype.toApolloError = function (result) {
|
|
6852
|
+
return isNonEmptyArray(result.errors)
|
|
6853
|
+
? new ApolloError({ graphQLErrors: result.errors })
|
|
6854
|
+
: result.error;
|
|
6855
|
+
};
|
|
6850
6856
|
InternalState.prototype.getCurrentResult = function () {
|
|
6851
6857
|
if (!this.result) {
|
|
6852
6858
|
this.handleErrorOrCompleted(this.result = this.observable.getCurrentResult());
|
|
@@ -7252,9 +7258,9 @@ function useSuspenseQuery_experimental(query, options) {
|
|
|
7252
7258
|
var hasFullResult = result.data && !result.partial;
|
|
7253
7259
|
var hasPartialResult = result.data && result.partial;
|
|
7254
7260
|
var usePartialResult = returnPartialData && hasPartialResult;
|
|
7261
|
+
var allowsThrownErrors = errorPolicy === 'none' && (!deferred || !hasPartialResult);
|
|
7255
7262
|
if (result.error &&
|
|
7256
|
-
|
|
7257
|
-
(!deferred || !hasPartialResult)) {
|
|
7263
|
+
(result.error.networkError || allowsThrownErrors)) {
|
|
7258
7264
|
throw result.error;
|
|
7259
7265
|
}
|
|
7260
7266
|
if (result.loading) {
|