graphlit-client 1.0.20240418023 → 1.0.20240418024
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/dist/client.js +3 -10
- package/package.json +1 -1
package/dist/client.js
CHANGED
@@ -91,11 +91,9 @@ class Graphlit {
|
|
91
91
|
cache: new core_1.InMemoryCache(),
|
92
92
|
defaultOptions: {
|
93
93
|
watchQuery: {
|
94
|
-
|
95
|
-
errorPolicy: 'ignore',
|
94
|
+
errorPolicy: 'all',
|
96
95
|
},
|
97
96
|
query: {
|
98
|
-
fetchPolicy: 'network-only',
|
99
97
|
errorPolicy: 'all',
|
100
98
|
},
|
101
99
|
mutate: {
|
@@ -436,7 +434,6 @@ class Graphlit {
|
|
436
434
|
}
|
437
435
|
queryAndCheckError(query, variables) {
|
438
436
|
return __awaiter(this, void 0, void 0, function* () {
|
439
|
-
var _a, _b;
|
440
437
|
if (this.client === undefined)
|
441
438
|
throw new Error("Apollo Client not configured.");
|
442
439
|
try {
|
@@ -444,12 +441,8 @@ class Graphlit {
|
|
444
441
|
query,
|
445
442
|
variables: variables || {}
|
446
443
|
});
|
447
|
-
if (
|
448
|
-
const errorMessage = result.
|
449
|
-
throw new Error(errorMessage);
|
450
|
-
}
|
451
|
-
if ((_b = result.error) === null || _b === void 0 ? void 0 : _b.clientErrors) {
|
452
|
-
const errorMessage = result.error.clientErrors.map(err => err.message).join("\n");
|
444
|
+
if (result.errors) {
|
445
|
+
const errorMessage = result.errors.map(err => err.message).join("\n");
|
453
446
|
throw new Error(errorMessage);
|
454
447
|
}
|
455
448
|
if (!result.data) {
|