@apollo/client 4.1.4 → 4.1.6
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/__cjs/core/ObservableQuery.cjs +13 -1
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/QueryManager.cjs +2 -3
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.cjs +5 -1
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/version.cjs +1 -1
- package/core/ObservableQuery.js +13 -1
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.js +3 -4
- package/core/QueryManager.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useQuery.js +5 -1
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks-compiled/useQuery.js +5 -1
- package/react/hooks-compiled/useQuery.js.map +1 -1
- package/version.js +1 -1
package/core/QueryManager.js
CHANGED
|
@@ -9,7 +9,7 @@ import { execute } from "@apollo/client/link";
|
|
|
9
9
|
import { maskFragment, maskOperation } from "@apollo/client/masking";
|
|
10
10
|
import { cacheSizes, DocumentTransform, isNetworkRequestInFlight, print, } from "@apollo/client/utilities";
|
|
11
11
|
import { __DEV__ } from "@apollo/client/utilities/environment";
|
|
12
|
-
import { AutoCleanedWeakCache, checkDocument, extensionsSymbol, filterMap, getDefaultValues, getOperationDefinition, getOperationName, graphQLResultHasError, hasDirectives, hasForcedResolvers, isDocumentNode, isNonNullObject, makeUniqueId, removeDirectivesFromDocument, streamInfoSymbol, toQueryResult, } from "@apollo/client/utilities/internal";
|
|
12
|
+
import { AutoCleanedWeakCache, checkDocument, extensionsSymbol, filterMap, getDefaultValues, getOperationDefinition, getOperationName, graphQLResultHasError, hasDirectives, hasForcedResolvers, isDocumentNode, isNonNullObject, makeUniqueId, mergeOptions, removeDirectivesFromDocument, streamInfoSymbol, toQueryResult, } from "@apollo/client/utilities/internal";
|
|
13
13
|
import { invariant, newInvariantError, } from "@apollo/client/utilities/invariant";
|
|
14
14
|
import { NetworkStatus } from "./networkStatus.js";
|
|
15
15
|
import { logMissingFieldErrors, ObservableQuery } from "./ObservableQuery.js";
|
|
@@ -400,7 +400,7 @@ export class QueryManager {
|
|
|
400
400
|
const oq = new ObservableQuery({
|
|
401
401
|
queryManager: this,
|
|
402
402
|
options: {
|
|
403
|
-
...options,
|
|
403
|
+
...mergeOptions(this.defaultOptions.watchQuery, options),
|
|
404
404
|
fetchPolicy: "network-only",
|
|
405
405
|
},
|
|
406
406
|
});
|
|
@@ -704,8 +704,7 @@ export class QueryManager {
|
|
|
704
704
|
// or setVariables.
|
|
705
705
|
networkStatus = NetworkStatus.loading, query = options.query, fetchQueryOperator = (x) => x, onCacheHit = () => { }, observableQuery, exposeExtensions, }) {
|
|
706
706
|
const variables = this.getVariables(query, options.variables);
|
|
707
|
-
|
|
708
|
-
let { fetchPolicy = (defaults && defaults.fetchPolicy) || "cache-first", errorPolicy = (defaults && defaults.errorPolicy) || "none", returnPartialData = false, notifyOnNetworkStatusChange = true, context = {}, } = options;
|
|
707
|
+
let { fetchPolicy = "cache-first", errorPolicy = "none", returnPartialData = false, notifyOnNetworkStatusChange = true, context = {}, } = options;
|
|
709
708
|
if (this.prioritizeCacheValues &&
|
|
710
709
|
(fetchPolicy === "network-only" || fetchPolicy === "cache-and-network")) {
|
|
711
710
|
fetchPolicy = "cache-first";
|