@apollo/client 3.11.2 → 3.11.3
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/CHANGELOG.md +16 -0
- package/apollo-client.cjs +105 -86
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/core/ObservableQuery.js +72 -43
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.js +19 -11
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +62 -43
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +62 -43
- package/dev/dev.cjs +72 -67
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +72 -67
- package/invariantErrorCodes.js +72 -66
- package/link/core/ApolloLink.js +2 -2
- package/link/core/core.cjs +2 -2
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +2 -2
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/http.cjs +3 -3
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +3 -3
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/persisted-queries/persisted-queries.cjs +2 -2
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
- package/link/utils/toPromise.js +1 -1
- package/link/utils/utils.cjs +2 -2
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/utils.cjs.native.js +2 -2
- package/link/utils/validateOperation.js +1 -1
- package/package.json +1 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs +3 -3
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +3 -3
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs +2 -2
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +2 -2
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs +9 -9
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +9 -9
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useSubscription.js +3 -3
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/internal/internal.cjs +2 -2
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +2 -2
- package/react/parser/index.js +5 -5
- package/react/parser/parser.cjs +5 -5
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +5 -5
- package/testing/core/core.cjs +2 -2
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +2 -2
- package/testing/core/mocking/mockLink.js +2 -2
- package/testing/internal/scenarios/index.d.ts +5 -0
- package/testing/internal/scenarios/index.js +1 -1
- package/testing/internal/scenarios/index.js.map +1 -1
- package/utilities/globals/globals.cjs +1 -1
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/graphql/directives.js +4 -4
- package/utilities/graphql/fragments.js +3 -3
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/utilities.cjs +19 -19
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +19 -19
- package/version.js +1 -1
package/core/core.cjs.native.js
CHANGED
|
@@ -20,7 +20,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
20
20
|
|
|
21
21
|
var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
|
|
22
22
|
|
|
23
|
-
var version = "3.11.
|
|
23
|
+
var version = "3.11.3";
|
|
24
24
|
|
|
25
25
|
function isNonNullObject(obj) {
|
|
26
26
|
return obj !== null && typeof obj === "object";
|
|
@@ -406,6 +406,11 @@ var ObservableQuery = (function (_super) {
|
|
|
406
406
|
this.observe();
|
|
407
407
|
}
|
|
408
408
|
var updatedQuerySet = new Set();
|
|
409
|
+
var updateQuery = fetchMoreOptions === null || fetchMoreOptions === void 0 ? void 0 : fetchMoreOptions.updateQuery;
|
|
410
|
+
var isCached = this.options.fetchPolicy !== "no-cache";
|
|
411
|
+
if (!isCached) {
|
|
412
|
+
globals.invariant(updateQuery, 21);
|
|
413
|
+
}
|
|
409
414
|
return this.queryManager
|
|
410
415
|
.fetchQuery(qid, combinedOptions, exports.NetworkStatus.fetchMore)
|
|
411
416
|
.then(function (fetchMoreResult) {
|
|
@@ -413,38 +418,48 @@ var ObservableQuery = (function (_super) {
|
|
|
413
418
|
if (queryInfo.networkStatus === exports.NetworkStatus.fetchMore) {
|
|
414
419
|
queryInfo.networkStatus = originalNetworkStatus;
|
|
415
420
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
421
|
+
if (isCached) {
|
|
422
|
+
_this.queryManager.cache.batch({
|
|
423
|
+
update: function (cache) {
|
|
424
|
+
var updateQuery = fetchMoreOptions.updateQuery;
|
|
425
|
+
if (updateQuery) {
|
|
426
|
+
cache.updateQuery({
|
|
427
|
+
query: _this.query,
|
|
428
|
+
variables: _this.variables,
|
|
429
|
+
returnPartialData: true,
|
|
430
|
+
optimistic: false,
|
|
431
|
+
}, function (previous) {
|
|
432
|
+
return updateQuery(previous, {
|
|
433
|
+
fetchMoreResult: fetchMoreResult.data,
|
|
434
|
+
variables: combinedOptions.variables,
|
|
435
|
+
});
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
cache.writeQuery({
|
|
440
|
+
query: combinedOptions.query,
|
|
428
441
|
variables: combinedOptions.variables,
|
|
442
|
+
data: fetchMoreResult.data,
|
|
429
443
|
});
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
onWatchUpdated: function (watch) {
|
|
447
|
+
updatedQuerySet.add(watch.query);
|
|
448
|
+
},
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
var lastResult = _this.getLast("result");
|
|
453
|
+
var data = updateQuery(lastResult.data, {
|
|
454
|
+
fetchMoreResult: fetchMoreResult.data,
|
|
455
|
+
variables: combinedOptions.variables,
|
|
456
|
+
});
|
|
457
|
+
_this.reportResult(tslib.__assign(tslib.__assign({}, lastResult), { data: data }), _this.variables);
|
|
458
|
+
}
|
|
444
459
|
return fetchMoreResult;
|
|
445
460
|
})
|
|
446
461
|
.finally(function () {
|
|
447
|
-
if (!updatedQuerySet.has(_this.query)) {
|
|
462
|
+
if (isCached && !updatedQuerySet.has(_this.query)) {
|
|
448
463
|
reobserveCacheFirst(_this);
|
|
449
464
|
}
|
|
450
465
|
});
|
|
@@ -475,7 +490,7 @@ var ObservableQuery = (function (_super) {
|
|
|
475
490
|
options.onError(err);
|
|
476
491
|
return;
|
|
477
492
|
}
|
|
478
|
-
globalThis.__DEV__ !== false && globals.invariant.error(
|
|
493
|
+
globalThis.__DEV__ !== false && globals.invariant.error(22, err);
|
|
479
494
|
},
|
|
480
495
|
});
|
|
481
496
|
this.subscriptions.add(subscription);
|
|
@@ -575,7 +590,7 @@ var ObservableQuery = (function (_super) {
|
|
|
575
590
|
if (pollingInfo && pollingInfo.interval === pollInterval) {
|
|
576
591
|
return;
|
|
577
592
|
}
|
|
578
|
-
globals.invariant(pollInterval,
|
|
593
|
+
globals.invariant(pollInterval, 23);
|
|
579
594
|
var info = pollingInfo || (this.pollingInfo = {});
|
|
580
595
|
info.interval = pollInterval;
|
|
581
596
|
var maybeFetch = function () {
|
|
@@ -749,11 +764,11 @@ function reobserveCacheFirst(obsQuery) {
|
|
|
749
764
|
return obsQuery.reobserve();
|
|
750
765
|
}
|
|
751
766
|
function defaultSubscriptionObserverErrorCallback(error) {
|
|
752
|
-
globalThis.__DEV__ !== false && globals.invariant.error(
|
|
767
|
+
globalThis.__DEV__ !== false && globals.invariant.error(24, error.message, error.stack);
|
|
753
768
|
}
|
|
754
769
|
function logMissingFieldErrors(missing) {
|
|
755
770
|
if (globalThis.__DEV__ !== false && missing) {
|
|
756
|
-
globalThis.__DEV__ !== false && globals.invariant.debug(
|
|
771
|
+
globalThis.__DEV__ !== false && globals.invariant.debug(25, missing);
|
|
757
772
|
}
|
|
758
773
|
}
|
|
759
774
|
function skipCacheDataFor(fetchPolicy ) {
|
|
@@ -1081,7 +1096,7 @@ var QueryManager = (function () {
|
|
|
1081
1096
|
this.queries.forEach(function (_info, queryId) {
|
|
1082
1097
|
_this.stopQueryNoBroadcast(queryId);
|
|
1083
1098
|
});
|
|
1084
|
-
this.cancelPendingFetches(globals.newInvariantError(
|
|
1099
|
+
this.cancelPendingFetches(globals.newInvariantError(26));
|
|
1085
1100
|
};
|
|
1086
1101
|
QueryManager.prototype.cancelPendingFetches = function (error) {
|
|
1087
1102
|
this.fetchCancelFns.forEach(function (cancel) { return cancel(error); });
|
|
@@ -1095,8 +1110,8 @@ var QueryManager = (function () {
|
|
|
1095
1110
|
return tslib.__generator(this, function (_j) {
|
|
1096
1111
|
switch (_j.label) {
|
|
1097
1112
|
case 0:
|
|
1098
|
-
globals.invariant(mutation,
|
|
1099
|
-
globals.invariant(fetchPolicy === "network-only" || fetchPolicy === "no-cache",
|
|
1113
|
+
globals.invariant(mutation, 27);
|
|
1114
|
+
globals.invariant(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 28);
|
|
1100
1115
|
mutationId = this.generateMutationId();
|
|
1101
1116
|
mutation = this.cache.transformForLink(this.transform(mutation));
|
|
1102
1117
|
hasClientExports = this.getDocumentInfo(mutation).hasClientExports;
|
|
@@ -1418,10 +1433,10 @@ var QueryManager = (function () {
|
|
|
1418
1433
|
QueryManager.prototype.query = function (options, queryId) {
|
|
1419
1434
|
var _this = this;
|
|
1420
1435
|
if (queryId === void 0) { queryId = this.generateQueryId(); }
|
|
1421
|
-
globals.invariant(options.query,
|
|
1422
|
-
globals.invariant(options.query.kind === "Document",
|
|
1423
|
-
globals.invariant(!options.returnPartialData,
|
|
1424
|
-
globals.invariant(!options.pollInterval,
|
|
1436
|
+
globals.invariant(options.query, 29);
|
|
1437
|
+
globals.invariant(options.query.kind === "Document", 30);
|
|
1438
|
+
globals.invariant(!options.returnPartialData, 31);
|
|
1439
|
+
globals.invariant(!options.pollInterval, 32);
|
|
1425
1440
|
return this.fetchQuery(queryId, tslib.__assign(tslib.__assign({}, options), { query: this.transform(options.query) })).finally(function () { return _this.stopQuery(queryId); });
|
|
1426
1441
|
};
|
|
1427
1442
|
QueryManager.prototype.generateQueryId = function () {
|
|
@@ -1446,7 +1461,7 @@ var QueryManager = (function () {
|
|
|
1446
1461
|
if (options === void 0) { options = {
|
|
1447
1462
|
discardWatches: true,
|
|
1448
1463
|
}; }
|
|
1449
|
-
this.cancelPendingFetches(globals.newInvariantError(
|
|
1464
|
+
this.cancelPendingFetches(globals.newInvariantError(33));
|
|
1450
1465
|
this.queries.forEach(function (queryInfo) {
|
|
1451
1466
|
if (queryInfo.observableQuery) {
|
|
1452
1467
|
queryInfo.networkStatus = exports.NetworkStatus.loading;
|
|
@@ -1522,7 +1537,7 @@ var QueryManager = (function () {
|
|
|
1522
1537
|
if (globalThis.__DEV__ !== false && queryNamesAndDocs.size) {
|
|
1523
1538
|
queryNamesAndDocs.forEach(function (included, nameOrDoc) {
|
|
1524
1539
|
if (!included) {
|
|
1525
|
-
globalThis.__DEV__ !== false && globals.invariant.warn(typeof nameOrDoc === "string" ?
|
|
1540
|
+
globalThis.__DEV__ !== false && globals.invariant.warn(typeof nameOrDoc === "string" ? 34 : 35, nameOrDoc);
|
|
1526
1541
|
}
|
|
1527
1542
|
});
|
|
1528
1543
|
}
|
|
@@ -1680,8 +1695,9 @@ var QueryManager = (function () {
|
|
|
1680
1695
|
return utilities.asyncMap(this.getObservableFromLink(linkDocument, options.context, options.variables), function (result) {
|
|
1681
1696
|
var graphQLErrors = utilities.getGraphQLErrorsFromResult(result);
|
|
1682
1697
|
var hasErrors = graphQLErrors.length > 0;
|
|
1698
|
+
var errorPolicy = options.errorPolicy;
|
|
1683
1699
|
if (requestId >= queryInfo.lastRequestId) {
|
|
1684
|
-
if (hasErrors &&
|
|
1700
|
+
if (hasErrors && errorPolicy === "none") {
|
|
1685
1701
|
throw queryInfo.markError(new errors.ApolloError({
|
|
1686
1702
|
graphQLErrors: graphQLErrors,
|
|
1687
1703
|
}));
|
|
@@ -1694,7 +1710,10 @@ var QueryManager = (function () {
|
|
|
1694
1710
|
loading: false,
|
|
1695
1711
|
networkStatus: exports.NetworkStatus.ready,
|
|
1696
1712
|
};
|
|
1697
|
-
if (hasErrors &&
|
|
1713
|
+
if (hasErrors && errorPolicy === "none") {
|
|
1714
|
+
aqr.data = void 0;
|
|
1715
|
+
}
|
|
1716
|
+
if (hasErrors && errorPolicy !== "ignore") {
|
|
1698
1717
|
aqr.errors = graphQLErrors;
|
|
1699
1718
|
aqr.networkStatus = exports.NetworkStatus.error;
|
|
1700
1719
|
}
|
package/dev/dev.cjs
CHANGED
|
@@ -67,85 +67,90 @@ const errorCodes =
|
|
|
67
67
|
condition: "fragment",
|
|
68
68
|
message: "No fragment named %s"
|
|
69
69
|
},
|
|
70
|
-
|
|
70
|
+
21: {
|
|
71
|
+
file: "@apollo/client/core/ObservableQuery.js",
|
|
72
|
+
condition: "updateQuery",
|
|
73
|
+
message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
|
|
74
|
+
},
|
|
75
|
+
23: {
|
|
71
76
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
72
77
|
condition: "pollInterval",
|
|
73
78
|
message: "Attempted to start a polling query without a polling interval."
|
|
74
79
|
},
|
|
75
|
-
|
|
80
|
+
26: {
|
|
76
81
|
file: "@apollo/client/core/QueryManager.js",
|
|
77
82
|
message: "QueryManager stopped while query was in flight"
|
|
78
83
|
},
|
|
79
|
-
|
|
84
|
+
27: {
|
|
80
85
|
file: "@apollo/client/core/QueryManager.js",
|
|
81
86
|
condition: "mutation",
|
|
82
87
|
message: "mutation option is required. You must specify your GraphQL document in the mutation option."
|
|
83
88
|
},
|
|
84
|
-
|
|
89
|
+
28: {
|
|
85
90
|
file: "@apollo/client/core/QueryManager.js",
|
|
86
91
|
condition: "fetchPolicy === \"network-only\" || fetchPolicy === \"no-cache\"",
|
|
87
92
|
message: "Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."
|
|
88
93
|
},
|
|
89
|
-
|
|
94
|
+
29: {
|
|
90
95
|
file: "@apollo/client/core/QueryManager.js",
|
|
91
96
|
condition: "options.query",
|
|
92
97
|
message: "query option is required. You must specify your GraphQL document " +
|
|
93
98
|
"in the query option."
|
|
94
99
|
},
|
|
95
|
-
|
|
100
|
+
30: {
|
|
96
101
|
file: "@apollo/client/core/QueryManager.js",
|
|
97
102
|
condition: "options.query.kind === \"Document\"",
|
|
98
103
|
message: 'You must wrap the query string in a "gql" tag.'
|
|
99
104
|
},
|
|
100
|
-
|
|
105
|
+
31: {
|
|
101
106
|
file: "@apollo/client/core/QueryManager.js",
|
|
102
107
|
condition: "!options.returnPartialData",
|
|
103
108
|
message: "returnPartialData option only supported on watchQuery."
|
|
104
109
|
},
|
|
105
|
-
|
|
110
|
+
32: {
|
|
106
111
|
file: "@apollo/client/core/QueryManager.js",
|
|
107
112
|
condition: "!options.pollInterval",
|
|
108
113
|
message: "pollInterval option only supported on watchQuery."
|
|
109
114
|
},
|
|
110
|
-
|
|
115
|
+
33: {
|
|
111
116
|
file: "@apollo/client/core/QueryManager.js",
|
|
112
117
|
message: "Store reset while query was in flight (not completed in link chain)"
|
|
113
118
|
},
|
|
114
|
-
|
|
119
|
+
37: {
|
|
115
120
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
116
121
|
message: "request is not implemented"
|
|
117
122
|
},
|
|
118
|
-
|
|
123
|
+
38: {
|
|
119
124
|
file: "@apollo/client/link/http/checkFetcher.js",
|
|
120
125
|
message: "\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "
|
|
121
126
|
},
|
|
122
|
-
|
|
127
|
+
40: {
|
|
123
128
|
file: "@apollo/client/link/http/serializeFetchParameter.js",
|
|
124
129
|
message: "Network request failed. %s is not serializable: %s"
|
|
125
130
|
},
|
|
126
|
-
|
|
131
|
+
41: {
|
|
127
132
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
128
133
|
condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
|
|
129
134
|
message: 'Missing/invalid "sha256" or "generateHash" function. Please ' +
|
|
130
135
|
'configure one using the "createPersistedQueryLink(options)" options ' +
|
|
131
136
|
"parameter."
|
|
132
137
|
},
|
|
133
|
-
|
|
138
|
+
42: {
|
|
134
139
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
135
140
|
condition: "forward",
|
|
136
141
|
message: "PersistedQueryLink cannot be the last link in the chain."
|
|
137
142
|
},
|
|
138
|
-
|
|
143
|
+
44: {
|
|
139
144
|
file: "@apollo/client/link/utils/validateOperation.js",
|
|
140
145
|
message: "illegal argument: %s"
|
|
141
146
|
},
|
|
142
|
-
|
|
147
|
+
45: {
|
|
143
148
|
file: "@apollo/client/react/context/ApolloConsumer.js",
|
|
144
149
|
condition: "context && context.client",
|
|
145
150
|
message: 'Could not find "client" in the context of ApolloConsumer. ' +
|
|
146
151
|
"Wrap the root component in an <ApolloProvider>."
|
|
147
152
|
},
|
|
148
|
-
|
|
153
|
+
46: {
|
|
149
154
|
file: "@apollo/client/react/context/ApolloContext.js",
|
|
150
155
|
condition: "\"createContext\" in React",
|
|
151
156
|
message: "Invoking `getApolloContext` in an environment where `React.createContext` is not available.\n" +
|
|
@@ -153,70 +158,70 @@ const errorCodes =
|
|
|
153
158
|
'Please make sure to add "use client" at the top of your file.\n' +
|
|
154
159
|
"For more information, see https://nextjs.org/docs/getting-started/react-essentials#client-components"
|
|
155
160
|
},
|
|
156
|
-
|
|
161
|
+
47: {
|
|
157
162
|
file: "@apollo/client/react/context/ApolloProvider.js",
|
|
158
163
|
condition: "context.client",
|
|
159
164
|
message: "ApolloProvider was not passed a client instance. Make " +
|
|
160
165
|
'sure you pass in your client via the "client" prop.'
|
|
161
166
|
},
|
|
162
|
-
|
|
167
|
+
48: {
|
|
163
168
|
file: "@apollo/client/react/hoc/hoc-utils.js",
|
|
164
169
|
condition: "this.withRef",
|
|
165
170
|
message: "To access the wrapped instance, you need to specify " +
|
|
166
171
|
"{ withRef: true } in the options"
|
|
167
172
|
},
|
|
168
|
-
|
|
173
|
+
49: {
|
|
169
174
|
file: "@apollo/client/react/hoc/withApollo.js",
|
|
170
175
|
condition: "operationOptions.withRef",
|
|
171
176
|
message: "To access the wrapped instance, you need to specify " +
|
|
172
177
|
"{ withRef: true } in the options"
|
|
173
178
|
},
|
|
174
|
-
|
|
179
|
+
50: {
|
|
175
180
|
file: "@apollo/client/react/hooks/useApolloClient.js",
|
|
176
181
|
condition: "!!client",
|
|
177
182
|
message: 'Could not find "client" in the context or passed in as an option. ' +
|
|
178
183
|
"Wrap the root component in an <ApolloProvider>, or pass an ApolloClient " +
|
|
179
184
|
"instance in via options."
|
|
180
185
|
},
|
|
181
|
-
|
|
186
|
+
51: {
|
|
182
187
|
file: "@apollo/client/react/hooks/useLoadableQuery.js",
|
|
183
188
|
condition: "!calledDuringRender()",
|
|
184
189
|
message: "useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook."
|
|
185
190
|
},
|
|
186
|
-
|
|
191
|
+
52: {
|
|
187
192
|
file: "@apollo/client/react/hooks/useLoadableQuery.js",
|
|
188
193
|
condition: "internalQueryRef",
|
|
189
194
|
message: "The query has not been loaded. Please load the query."
|
|
190
195
|
},
|
|
191
|
-
|
|
196
|
+
57: {
|
|
192
197
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
193
198
|
condition: "!optionsRef.current.skip",
|
|
194
199
|
message: "A subscription that is skipped cannot be restarted."
|
|
195
200
|
},
|
|
196
|
-
|
|
201
|
+
58: {
|
|
197
202
|
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
198
203
|
condition: "supportedFetchPolicies.includes(fetchPolicy)",
|
|
199
204
|
message: "The fetch policy `%s` is not supported with suspense."
|
|
200
205
|
},
|
|
201
|
-
|
|
206
|
+
61: {
|
|
202
207
|
file: "@apollo/client/react/internal/cache/QueryReference.js",
|
|
203
208
|
condition: "!queryRef || QUERY_REFERENCE_SYMBOL in queryRef",
|
|
204
209
|
message: "Expected a QueryRef object, but got something else instead."
|
|
205
210
|
},
|
|
206
|
-
|
|
211
|
+
62: {
|
|
207
212
|
file: "@apollo/client/react/parser/index.js",
|
|
208
213
|
condition: "!!document && !!document.kind",
|
|
209
214
|
message: "Argument of %s passed to parser was not a valid GraphQL " +
|
|
210
215
|
"DocumentNode. You may need to use 'graphql-tag' or another method " +
|
|
211
216
|
"to convert your operation into a document"
|
|
212
217
|
},
|
|
213
|
-
|
|
218
|
+
63: {
|
|
214
219
|
file: "@apollo/client/react/parser/index.js",
|
|
215
220
|
condition: "!fragments.length ||\n queries.length ||\n mutations.length ||\n subscriptions.length",
|
|
216
221
|
message: "Passing only a fragment to 'graphql' is not yet supported. " +
|
|
217
222
|
"You must include a query, subscription or mutation as well"
|
|
218
223
|
},
|
|
219
|
-
|
|
224
|
+
64: {
|
|
220
225
|
file: "@apollo/client/react/parser/index.js",
|
|
221
226
|
condition: "queries.length + mutations.length + subscriptions.length <= 1",
|
|
222
227
|
message: "react-apollo only supports a query, subscription, or a mutation per HOC. " +
|
|
@@ -224,107 +229,107 @@ const errorCodes =
|
|
|
224
229
|
"subscriptions and %s mutations. " +
|
|
225
230
|
"You can use 'compose' to join multiple operation types to a component"
|
|
226
231
|
},
|
|
227
|
-
|
|
232
|
+
65: {
|
|
228
233
|
file: "@apollo/client/react/parser/index.js",
|
|
229
234
|
condition: "definitions.length === 1",
|
|
230
235
|
message: "react-apollo only supports one definition per HOC. %s had " +
|
|
231
236
|
"%s definitions. " +
|
|
232
237
|
"You can use 'compose' to join multiple operation types to a component"
|
|
233
238
|
},
|
|
234
|
-
|
|
239
|
+
66: {
|
|
235
240
|
file: "@apollo/client/react/parser/index.js",
|
|
236
241
|
condition: "operation.type === type",
|
|
237
242
|
message: "Running a %s requires a graphql " + "%s, but a %s was used instead."
|
|
238
243
|
},
|
|
239
|
-
|
|
244
|
+
67: {
|
|
240
245
|
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
241
246
|
condition: "queryWithoutClientOnlyDirectives",
|
|
242
247
|
message: "query is required"
|
|
243
248
|
},
|
|
244
|
-
|
|
249
|
+
68: {
|
|
245
250
|
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
246
251
|
condition: "mockedResponse.maxUsageCount > 0",
|
|
247
252
|
message: "Mock response maxUsageCount must be greater than 0, %s given"
|
|
248
253
|
},
|
|
249
|
-
|
|
254
|
+
69: {
|
|
250
255
|
file: "@apollo/client/utilities/graphql/DocumentTransform.js",
|
|
251
256
|
condition: "Array.isArray(cacheKeys)",
|
|
252
257
|
message: "`getCacheKey` must return an array or undefined"
|
|
253
258
|
},
|
|
254
|
-
|
|
259
|
+
70: {
|
|
255
260
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
256
261
|
condition: "evaledValue !== void 0",
|
|
257
262
|
message: "Invalid variable referenced in @%s directive."
|
|
258
263
|
},
|
|
259
|
-
|
|
264
|
+
71: {
|
|
260
265
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
261
266
|
condition: "directiveArguments && directiveArguments.length === 1",
|
|
262
267
|
message: "Incorrect number of arguments for the @%s directive."
|
|
263
268
|
},
|
|
264
|
-
|
|
269
|
+
72: {
|
|
265
270
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
266
271
|
condition: "ifArgument.name && ifArgument.name.value === \"if\"",
|
|
267
272
|
message: "Invalid argument for the @%s directive."
|
|
268
273
|
},
|
|
269
|
-
|
|
274
|
+
73: {
|
|
270
275
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
271
276
|
condition: "ifValue &&\n (ifValue.kind === \"Variable\" || ifValue.kind === \"BooleanValue\")",
|
|
272
277
|
message: "Argument for the @%s directive must be a variable or a boolean value."
|
|
273
278
|
},
|
|
274
|
-
|
|
279
|
+
74: {
|
|
275
280
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
276
281
|
message: "Found a %s operation%s. " +
|
|
277
282
|
"No operations are allowed when using a fragment as a query. Only fragments are allowed."
|
|
278
283
|
},
|
|
279
|
-
|
|
284
|
+
75: {
|
|
280
285
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
281
286
|
condition: "fragments.length === 1",
|
|
282
287
|
message: "Found %s fragments. `fragmentName` must be provided when there is not exactly 1 fragment."
|
|
283
288
|
},
|
|
284
|
-
|
|
289
|
+
76: {
|
|
285
290
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
286
291
|
condition: "fragment",
|
|
287
292
|
message: "No fragment named %s"
|
|
288
293
|
},
|
|
289
|
-
|
|
294
|
+
77: {
|
|
290
295
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
291
296
|
condition: "doc && doc.kind === \"Document\"",
|
|
292
297
|
message: "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"
|
|
293
298
|
},
|
|
294
|
-
|
|
299
|
+
78: {
|
|
295
300
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
296
301
|
message: "Schema type definitions not allowed in queries. Found: \"%s\""
|
|
297
302
|
},
|
|
298
|
-
|
|
303
|
+
79: {
|
|
299
304
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
300
305
|
condition: "operations.length <= 1",
|
|
301
306
|
message: "Ambiguous GraphQL document: contains %s operations"
|
|
302
307
|
},
|
|
303
|
-
|
|
308
|
+
80: {
|
|
304
309
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
305
310
|
condition: "queryDef && queryDef.operation === \"query\"",
|
|
306
311
|
message: "Must contain a query definition."
|
|
307
312
|
},
|
|
308
|
-
|
|
313
|
+
81: {
|
|
309
314
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
310
315
|
condition: "doc.kind === \"Document\"",
|
|
311
316
|
message: "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"
|
|
312
317
|
},
|
|
313
|
-
|
|
318
|
+
82: {
|
|
314
319
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
315
320
|
condition: "doc.definitions.length <= 1",
|
|
316
321
|
message: "Fragment must have exactly one definition."
|
|
317
322
|
},
|
|
318
|
-
|
|
323
|
+
83: {
|
|
319
324
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
320
325
|
condition: "fragmentDef.kind === \"FragmentDefinition\"",
|
|
321
326
|
message: "Must be a fragment definition."
|
|
322
327
|
},
|
|
323
|
-
|
|
328
|
+
84: {
|
|
324
329
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
325
330
|
message: "Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."
|
|
326
331
|
},
|
|
327
|
-
|
|
332
|
+
85: {
|
|
328
333
|
file: "@apollo/client/utilities/graphql/storeUtils.js",
|
|
329
334
|
message: "The inline argument \"%s\" of kind \"%s\"" +
|
|
330
335
|
"is not supported. Use variables instead of inline arguments to " +
|
|
@@ -336,7 +341,7 @@ const devDebug = {
|
|
|
336
341
|
file: "@apollo/client/core/ApolloClient.js",
|
|
337
342
|
message: "In client.refetchQueries, Promise.all promise rejected with error %o"
|
|
338
343
|
},
|
|
339
|
-
|
|
344
|
+
25: {
|
|
340
345
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
341
346
|
message: "Missing cache result fields: %o"
|
|
342
347
|
}
|
|
@@ -370,47 +375,47 @@ const devWarn = {
|
|
|
370
375
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
371
376
|
message: "Called refetch(%o) for query %o, which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"
|
|
372
377
|
},
|
|
373
|
-
|
|
378
|
+
34: {
|
|
374
379
|
file: "@apollo/client/core/QueryManager.js",
|
|
375
380
|
message: "Unknown query named \"%s\" requested in refetchQueries options.include array"
|
|
376
381
|
},
|
|
377
|
-
|
|
382
|
+
35: {
|
|
378
383
|
file: "@apollo/client/core/QueryManager.js",
|
|
379
384
|
message: "Unknown query %o requested in refetchQueries options.include array"
|
|
380
385
|
},
|
|
381
|
-
|
|
386
|
+
36: {
|
|
382
387
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
383
388
|
message: "You are calling concat on a terminating link, which will have no effect %o"
|
|
384
389
|
},
|
|
385
|
-
|
|
390
|
+
39: {
|
|
386
391
|
file: "@apollo/client/link/http/createHttpLink.js",
|
|
387
392
|
message: "Multipart-subscriptions do not support @defer"
|
|
388
393
|
},
|
|
389
|
-
|
|
394
|
+
43: {
|
|
390
395
|
file: "@apollo/client/link/utils/toPromise.js",
|
|
391
396
|
message: "Promise Wrapper does not support multiple results from Observable"
|
|
392
397
|
},
|
|
393
|
-
|
|
398
|
+
53: {
|
|
394
399
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
395
400
|
message: "'useSubscription' supports only the 'onSubscriptionData' or 'onData' option, but not both. Only the 'onData' option will be used."
|
|
396
401
|
},
|
|
397
|
-
|
|
402
|
+
54: {
|
|
398
403
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
399
404
|
message: "'onSubscriptionData' is deprecated and will be removed in a future major version. Please use the 'onData' option instead."
|
|
400
405
|
},
|
|
401
|
-
|
|
406
|
+
55: {
|
|
402
407
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
403
408
|
message: "'useSubscription' supports only the 'onSubscriptionComplete' or 'onComplete' option, but not both. Only the 'onComplete' option will be used."
|
|
404
409
|
},
|
|
405
|
-
|
|
410
|
+
56: {
|
|
406
411
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
407
412
|
message: "'onSubscriptionComplete' is deprecated and will be removed in a future major version. Please use the 'onComplete' option instead."
|
|
408
413
|
},
|
|
409
|
-
|
|
414
|
+
59: {
|
|
410
415
|
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
411
416
|
message: "Using `returnPartialData` with a `no-cache` fetch policy has no effect. To read partial data from the cache, consider using an alternate fetch policy."
|
|
412
417
|
},
|
|
413
|
-
|
|
418
|
+
87: {
|
|
414
419
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
415
420
|
message: "Removing an @connection directive even though it does not have a key. " +
|
|
416
421
|
"You may want to use the key parameter to specify a store key."
|
|
@@ -421,25 +426,25 @@ const devError = {
|
|
|
421
426
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
422
427
|
message: "Missing field '%s' while writing result %o"
|
|
423
428
|
},
|
|
424
|
-
|
|
429
|
+
22: {
|
|
425
430
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
426
431
|
message: "Unhandled GraphQL subscription error"
|
|
427
432
|
},
|
|
428
|
-
|
|
433
|
+
24: {
|
|
429
434
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
430
435
|
message: "Unhandled error"
|
|
431
436
|
},
|
|
432
|
-
|
|
437
|
+
60: {
|
|
433
438
|
file: "@apollo/client/react/hooks/useSyncExternalStore.js",
|
|
434
439
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
435
440
|
},
|
|
436
|
-
|
|
441
|
+
86: {
|
|
437
442
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
438
443
|
message: "Could not find operation or fragment"
|
|
439
444
|
}
|
|
440
445
|
};
|
|
441
446
|
|
|
442
|
-
var version = "3.11.
|
|
447
|
+
var version = "3.11.3";
|
|
443
448
|
|
|
444
449
|
function maybe(thunk) {
|
|
445
450
|
try {
|