@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.
@@ -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
- const defaults = this.defaultOptions.watchQuery;
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";