Socket
Socket
Sign inDemoInstall

@apollo/client

Package Overview
Dependencies
Maintainers
4
Versions
575
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apollo/client - npm Package Compare versions

Comparing version 0.0.0-pr-11465-20240125173354 to 0.0.0-pr-11465-20240315183534

react/hooks/internal/wrapHook.d.ts

40

cache/core/cache.d.ts

@@ -10,10 +10,34 @@ import type { DocumentNode } from "graphql";

export type Transaction<T> = (c: ApolloCache<T>) => void;
/**
* Watched fragment options.
*/
export interface WatchFragmentOptions<TData, TVars> {
/**
* **Required.** A GraphQL fragment document parsed into an AST with the `gql`
* template literal.
*/
fragment: DocumentNode | TypedDocumentNode<TData, TVars>;
/**
* **Required.** An object containing a `__typename` and primary key fields
* (such as `id`) identifying the entity object from which the fragment will
* be retrieved, or a `{ __ref: "..." }` reference, or a `string` ID
* (uncommon).
*/
from: StoreObject | Reference | string;
/**
* Any variables that the GraphQL query may depend on.
* Any variables that the GraphQL fragment may depend on.
*/
variables?: TVars;
/**
* The name of the fragment defined in the fragment document.
*
* **Required** if the fragment document includes more than one fragment,
* optional otherwise.
*/
fragmentName?: string;
/**
* If `true`, `watchFragment` returns optimistic results.
*
* The default value is `true`.
*/
optimistic?: boolean;

@@ -32,2 +56,5 @@ /**

}
/**
* Watched fragment results.
*/
export type WatchFragmentResult<TData> = {

@@ -72,2 +99,13 @@ data: TData;

readQuery<QueryType, TVariables = any>(options: Cache.ReadQueryOptions<QueryType, TVariables>, optimistic?: boolean): QueryType | null;
/**
* Watches the cache store of the fragment according to the options specified and returns an Observable. We can subscribe to this Observable and receive updated results through a GraphQL observer when the cache store changes.
*
* You must pass in a GraphQL document with a single fragment or a document with multiple fragments that represent what you are reading. If you pass in a document with multiple fragments then you must also specify a `fragmentName`.
*
* @param options - An object of type `WatchFragmentOptions` that allows the cache to identify the fragment and optionally specify whether to react to optimistic updates.
*
* @since
*
* 3.10.0
*/
watchFragment<TData = any, TVars = OperationVariables>(options: WatchFragmentOptions<TData, TVars>): Observable<WatchFragmentResult<TData>>;

@@ -74,0 +112,0 @@ private getFragmentDoc;

13

cache/core/cache.js

@@ -61,2 +61,3 @@ import { __assign, __rest } from "tslib";

};
/** {@inheritDoc @apollo/client!ApolloClient#watchFragment:member(1)} */
ApolloCache.prototype.watchFragment = function (options) {

@@ -71,6 +72,8 @@ var _this = this;

};
// let latestDiff: DataProxy.DiffResult<TData> | undefined = undefined;
var latestDiff = this.diff(diffOptions);
var latestDiff;
return new Observable(function (observer) {
return _this.watch(__assign(__assign({}, diffOptions), { immediate: true, query: _this.getFragmentDoc(fragment, fragmentName), callback: function (diff) {
if (equal(diff, latestDiff)) {
return;
}
var result = {

@@ -83,6 +86,4 @@ data: diff.result,

}
if (!equal(diff, latestDiff)) {
latestDiff = diff;
observer.next(result);
}
latestDiff = diff;
observer.next(result);
} }));

@@ -89,0 +90,0 @@ });

@@ -62,12 +62,7 @@ import type { DocumentNode } from "graphql";

/**
/**
* Whether to canonize cache results before returning them. Canonization takes some extra time, but it speeds up future deep equality comparisons. Defaults to false.
*
* @deprecated
* Using `canonizeResults` can result in memory leaks so we generally do not
* recommend using this option anymore.
* A future version of Apollo Client will contain a similar feature without
* the risk of memory leaks.
*
* Whether to canonize cache results before returning them. Canonization
* takes some extra time, but it speeds up future deep equality comparisons.
* Defaults to false.
*
* Using `canonizeResults` can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.
*/

@@ -89,10 +84,7 @@ canonizeResults?: boolean;

/**
* Whether to canonize cache results before returning them. Canonization takes some extra time, but it speeds up future deep equality comparisons. Defaults to false.
*
* @deprecated
* Using `canonizeResults` can result in memory leaks so we generally do not
* recommend using this option anymore.
* A future version of Apollo Client will contain a similar feature.
*
* Whether to canonize cache results before returning them. Canonization
* takes some extra time, but it speeds up future deep equality comparisons.
* Defaults to false.
*
* Using `canonizeResults` can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.
*/

@@ -99,0 +91,0 @@ canonizeResults?: boolean;

@@ -59,3 +59,3 @@ import { __assign } from "tslib";

cacheSizes["inMemoryCache.executeSelectionSet"] ||
10000 /* defaultCacheSizes["inMemoryCache.executeSelectionSet"] */,
50000 /* defaultCacheSizes["inMemoryCache.executeSelectionSet"] */,
keyArgs: execSelectionSetKeyArgs,

@@ -76,3 +76,3 @@ // Note that the parameters of makeCacheKey are determined by the

cacheSizes["inMemoryCache.executeSubSelectedArray"] ||
5000 /* defaultCacheSizes["inMemoryCache.executeSubSelectedArray"] */,
10000 /* defaultCacheSizes["inMemoryCache.executeSubSelectedArray"] */,
makeCacheKey: function (_a) {

@@ -79,0 +79,0 @@ var field = _a.field, array = _a.array, context = _a.context;

@@ -101,3 +101,2 @@ import type { DocumentNode, FieldNode } from "graphql";

* Please use `cacheSizes` instead.
* TODO: write docs page, add link here
*/

@@ -104,0 +103,0 @@ resultCacheMaxSize?: number;

@@ -24,5 +24,10 @@ import type { ExecutionResult, DocumentNode } from "graphql";

credentials?: string;
/**
* An object representing headers to include in every HTTP request, such as `{Authorization: 'Bearer 1234'}`
*
* This value will be ignored when using the `link` option.
*/
headers?: Record<string, string>;
/**
* You can provide an {@link ApolloLink} instance to serve as Apollo Client's network layer. For more information, see [Advanced HTTP networking](https://www.apollographql.com/docs/react/networking/advanced-http-networking/).
* You can provide an `ApolloLink` instance to serve as Apollo Client's network layer. For more information, see [Advanced HTTP networking](https://www.apollographql.com/docs/react/networking/advanced-http-networking/).
*

@@ -45,3 +50,3 @@ * One of `uri` or `link` is **required**. If you provide both, `link` takes precedence.

/**
* When using Apollo Client for [server-side rendering](https://www.apollographql.com/docs/react//performance/server-side-rendering/), set this to `true` so that the [`getDataFromTree` function](../react/ssr/#getdatafromtree) can work effectively.
* When using Apollo Client for [server-side rendering](https://www.apollographql.com/docs/react/performance/server-side-rendering/), set this to `true` so that the [`getDataFromTree` function](../react/ssr/#getdatafromtree) can work effectively.
*

@@ -93,9 +98,9 @@ * @defaultValue `false`

import { getApolloClientMemoryInternals } from "../utilities/caching/getMemoryInternals.js";
import type { WatchFragmentOptions } from "../cache/core/cache.js";
import type { WatchFragmentOptions, WatchFragmentResult } from "../cache/core/cache.js";
export { mergeOptions };
/**
* This is the primary Apollo Client class. It is used to send GraphQL documents (i.e. queries
* and mutations) to a GraphQL spec-compliant server over an {@link ApolloLink} instance,
* and mutations) to a GraphQL spec-compliant server over an `ApolloLink` instance,
* receive results from the server and cache the results in a store. It also delivers updates
* to GraphQL queries through {@link Observable} instances.
* to GraphQL queries through `Observable` instances.
*/

@@ -116,3 +121,3 @@ export declare class ApolloClient<TCacheShape> implements DataProxy {

/**
* Constructs an instance of {@link ApolloClient}.
* Constructs an instance of `ApolloClient`.
*

@@ -157,3 +162,3 @@ * @example

* This watches the cache store of the query according to the options specified and
* returns an {@link ObservableQuery}. We can subscribe to this {@link ObservableQuery} and
* returns an `ObservableQuery`. We can subscribe to this `ObservableQuery` and
* receive updated results through a GraphQL observer when the cache store changes.

@@ -181,3 +186,3 @@ *

*
* @param options - An object of type {@link QueryOptions} that allows us to
* @param options - An object of type `QueryOptions` that allows us to
* describe how this query should be treated e.g. whether it should hit the

@@ -190,3 +195,4 @@ * server at all or just resolve from the cache, etc.

* Promise which is either resolved with the resulting data or rejected with an
* error.
* error. In some cases both `data` and `errors` might be undefined, for example
* when `errorPolicy` is set to `'ignore'`.
*

@@ -198,3 +204,3 @@ * It takes options as an object with the following keys and values:

* This subscribes to a graphql subscription according to the options specified and returns an
* {@link Observable} which either emits received data or an error.
* `Observable` which either emits received data or an error.
*/

@@ -214,4 +220,4 @@ subscribe<T = any, TVariables extends OperationVariables = OperationVariables>(options: SubscriptionOptions<TVariables, T>): Observable<FetchResult<T>>;

* Watches the cache store of the fragment according to the options specified
* and returns an {@link Observable}. We can subscribe to this
* {@link Observable} and receive updated results through a GraphQL
* and returns an Observable. We can subscribe to this
* Observable and receive updated results through a GraphQL
* observer when the cache store changes.

@@ -224,7 +230,8 @@ *

*
* @param options - An object of type {@link WatchFragmentOptions} that allows
* @since 3.10.0
* @param options - An object of type `WatchFragmentOptions` that allows
* the cache to identify the fragment and optionally specify whether to react
* to optimistic updates.
*/
watchFragment<TFragmentData = unknown, TVariables = OperationVariables>(options: WatchFragmentOptions<TFragmentData, TVariables>): Observable<import("../cache/core/cache.js").WatchFragmentResult<TFragmentData>>;
watchFragment<TFragmentData = unknown, TVariables = OperationVariables>(options: WatchFragmentOptions<TFragmentData, TVariables>): Observable<WatchFragmentResult<TFragmentData>>;
/**

@@ -231,0 +238,0 @@ * Tries to read some data from the store in the shape of the provided

@@ -18,9 +18,9 @@ import { __assign } from "tslib";

* This is the primary Apollo Client class. It is used to send GraphQL documents (i.e. queries
* and mutations) to a GraphQL spec-compliant server over an {@link ApolloLink} instance,
* and mutations) to a GraphQL spec-compliant server over an `ApolloLink` instance,
* receive results from the server and cache the results in a store. It also delivers updates
* to GraphQL queries through {@link Observable} instances.
* to GraphQL queries through `Observable` instances.
*/
var ApolloClient = /** @class */ (function () {
/**
* Constructs an instance of {@link ApolloClient}.
* Constructs an instance of `ApolloClient`.
*

@@ -187,3 +187,3 @@ * @example

* This watches the cache store of the query according to the options specified and
* returns an {@link ObservableQuery}. We can subscribe to this {@link ObservableQuery} and
* returns an `ObservableQuery`. We can subscribe to this `ObservableQuery` and
* receive updated results through a GraphQL observer when the cache store changes.

@@ -222,3 +222,3 @@ *

*
* @param options - An object of type {@link QueryOptions} that allows us to
* @param options - An object of type `QueryOptions` that allows us to
* describe how this query should be treated e.g. whether it should hit the

@@ -240,3 +240,4 @@ * server at all or just resolve from the cache, etc.

* Promise which is either resolved with the resulting data or rejected with an
* error.
* error. In some cases both `data` and `errors` might be undefined, for example
* when `errorPolicy` is set to `'ignore'`.
*

@@ -253,3 +254,3 @@ * It takes options as an object with the following keys and values:

* This subscribes to a graphql subscription according to the options specified and returns an
* {@link Observable} which either emits received data or an error.
* `Observable` which either emits received data or an error.
*/

@@ -274,4 +275,4 @@ ApolloClient.prototype.subscribe = function (options) {

* Watches the cache store of the fragment according to the options specified
* and returns an {@link Observable}. We can subscribe to this
* {@link Observable} and receive updated results through a GraphQL
* and returns an Observable. We can subscribe to this
* Observable and receive updated results through a GraphQL
* observer when the cache store changes.

@@ -284,3 +285,4 @@ *

*
* @param options - An object of type {@link WatchFragmentOptions} that allows
* @since 3.10.0
* @param options - An object of type `WatchFragmentOptions` that allows
* the cache to identify the fragment and optionally specify whether to react

@@ -287,0 +289,0 @@ * to optimistic updates.

@@ -45,5 +45,5 @@ import { __assign, __awaiter, __generator } from "tslib";

LocalState.prototype.runResolvers = function (_a) {
var document = _a.document, remoteResult = _a.remoteResult, context = _a.context, variables = _a.variables, _b = _a.onlyRunForcedResolvers, onlyRunForcedResolvers = _b === void 0 ? false : _b;
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_c) {
return __awaiter(this, arguments, void 0, function (_b) {
var document = _b.document, remoteResult = _b.remoteResult, context = _b.context, variables = _b.variables, _c = _b.onlyRunForcedResolvers, onlyRunForcedResolvers = _c === void 0 ? false : _c;
return __generator(this, function (_d) {
if (document) {

@@ -87,6 +87,6 @@ return [2 /*return*/, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { return (__assign(__assign({}, remoteResult), { data: localResult.result })); })];

// used alongside the original operation variables.
LocalState.prototype.addExportedVariables = function (document, variables, context) {
if (variables === void 0) { variables = {}; }
if (context === void 0) { context = {}; }
return __awaiter(this, void 0, void 0, function () {
LocalState.prototype.addExportedVariables = function (document_1) {
return __awaiter(this, arguments, void 0, function (document, variables, context) {
if (variables === void 0) { variables = {}; }
if (context === void 0) { context = {}; }
return __generator(this, function (_a) {

@@ -129,9 +129,9 @@ if (document) {

};
LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) {
if (context === void 0) { context = {}; }
if (variables === void 0) { variables = {}; }
if (fragmentMatcher === void 0) { fragmentMatcher = function () { return true; }; }
if (onlyRunForcedResolvers === void 0) { onlyRunForcedResolvers = false; }
return __awaiter(this, void 0, void 0, function () {
LocalState.prototype.resolveDocument = function (document_1, rootValue_1) {
return __awaiter(this, arguments, void 0, function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) {
var mainDefinition, fragments, fragmentMap, selectionsToResolve, definitionOperation, defaultOperationType, _a, cache, client, execContext, isClientFieldDescendant;
if (context === void 0) { context = {}; }
if (variables === void 0) { variables = {}; }
if (fragmentMatcher === void 0) { fragmentMatcher = function () { return true; }; }
if (onlyRunForcedResolvers === void 0) { onlyRunForcedResolvers = false; }
return __generator(this, function (_b) {

@@ -138,0 +138,0 @@ mainDefinition = getMainDefinition(document);

@@ -25,2 +25,5 @@ import { NetworkStatus } from "./networkStatus.js";

get query(): TypedDocumentNode<TData, TVariables>;
/**
* An object containing the variables that were provided for the query.
*/
get variables(): TVariables | undefined;

@@ -61,2 +64,5 @@ private isTornDown;

refetch(variables?: Partial<TVariables>): Promise<ApolloQueryResult<TData>>;
/**
* A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).
*/
fetchMore<TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {

@@ -68,2 +74,7 @@ updateQuery?: (previousQueryResult: TData, options: {

}): Promise<ApolloQueryResult<TFetchData>>;
/**
* A function that enables you to execute a [subscription](https://www.apollographql.com/docs/react/data/subscriptions/), usually to subscribe to specific fields that were included in the query.
*
* This function returns _another_ function that you can call to terminate the subscription.
*/
subscribeToMore<TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>): () => void;

@@ -91,4 +102,15 @@ setOptions(newOptions: Partial<WatchQueryOptions<TVariables, TData>>): Promise<ApolloQueryResult<TData>>;

setVariables(variables: TVariables): Promise<ApolloQueryResult<TData> | void>;
/**
* A function that enables you to update the query's cached result without executing a followup GraphQL operation.
*
* See [using updateQuery and updateFragment](https://www.apollographql.com/docs/react/caching/cache-interaction/#using-updatequery-and-updatefragment) for additional information.
*/
updateQuery<TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData): void;
/**
* A function that instructs the query to begin re-executing at a specified interval (in milliseconds).
*/
startPolling(pollInterval: number): void;
/**
* A function that instructs the query to stop polling after a previous call to `startPolling`.
*/
stopPolling(): void;

@@ -95,0 +117,0 @@ private applyNextFetchPolicy;

@@ -88,2 +88,5 @@ import { __assign, __extends } from "tslib";

// backwards compatibility.
/**
* An object containing the variables that were provided for the query.
*/
get: function () {

@@ -272,2 +275,5 @@ return this.options.variables;

};
/**
* A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).
*/
ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) {

@@ -365,2 +371,7 @@ var _this = this;

// and you can only do it by stopping the subscription and then subscribing again with new variables.
/**
* A function that enables you to execute a [subscription](https://www.apollographql.com/docs/react/data/subscriptions/), usually to subscribe to specific fields that were included in the query.
*
* This function returns _another_ function that you can call to terminate the subscription.
*/
ObservableQuery.prototype.subscribeToMore = function (options) {

@@ -445,2 +456,7 @@ var _this = this;

};
/**
* A function that enables you to update the query's cached result without executing a followup GraphQL operation.
*
* See [using updateQuery and updateFragment](https://www.apollographql.com/docs/react/caching/cache-interaction/#using-updatequery-and-updatefragment) for additional information.
*/
ObservableQuery.prototype.updateQuery = function (mapFn) {

@@ -466,2 +482,5 @@ var queryManager = this.queryManager;

};
/**
* A function that instructs the query to begin re-executing at a specified interval (in milliseconds).
*/
ObservableQuery.prototype.startPolling = function (pollInterval) {

@@ -471,2 +490,5 @@ this.options.pollInterval = pollInterval;

};
/**
* A function that instructs the query to stop polling after a previous call to `startPolling`.
*/
ObservableQuery.prototype.stopPolling = function () {

@@ -473,0 +495,0 @@ this.options.pollInterval = 0;

@@ -56,3 +56,3 @@ import type { DocumentNode, GraphQLError } from "graphql";

private shouldWrite;
markResult<T>(result: FetchResult<T>, document: DocumentNode, options: Pick<WatchQueryOptions, "variables" | "fetchPolicy" | "errorPolicy">, cacheWriteBehavior: CacheWriteBehavior): typeof result;
markResult<T>(result: FetchResult<T>, document: DocumentNode, options: Pick<WatchQueryOptions, "variables" | "fetchPolicy" | "errorPolicy">, cacheWriteBehavior: CacheWriteBehavior): void;
markReady(): NetworkStatus;

@@ -59,0 +59,0 @@ markError(error: ApolloError): ApolloError;

@@ -134,3 +134,20 @@ import { __assign } from "tslib";

var _this = this;
var _a;
var oldDiff = this.lastDiff && this.lastDiff.diff;
// If we do not tolerate partial results, skip this update to prevent it
// from being reported. This prevents a situtuation where a query that
// errors and another succeeds with overlapping data does not report the
// partial data result to the errored query.
//
// See https://github.com/apollographql/apollo-client/issues/11400 for more
// information on this issue.
if (diff &&
!diff.complete &&
!((_a = this.observableQuery) === null || _a === void 0 ? void 0 : _a.options.returnPartialData) &&
// In the case of a cache eviction, the diff will become partial so we
// schedule a notification to send a network request (this.oqListener) to
// go and fetch the missing data.
!(oldDiff && oldDiff.complete)) {
return;
}
this.updateLastDiff(diff);

@@ -246,3 +263,2 @@ if (!this.dirty && !equal(oldDiff && oldDiff.result, diff && diff.result)) {

var _this = this;
result = __assign({}, result);
var merger = new DeepMerger();

@@ -285,6 +301,3 @@ var graphQLErrors = isNonEmptyArray(result.errors) ? result.errors.slice(0) : [];

_this.lastWrite = {
// Make a shallow defensive copy of the result object, in case we
// later later modify result.data in place, since we don't want
// that mutation affecting the saved lastWrite.result.data.
result: __assign({}, result),
result: result,
variables: options.variables,

@@ -349,8 +362,11 @@ dmCount: destructiveMethodCounts.get(_this.cache),

}
// If we're allowed to write to the cache, update result.data to be
// the result as re-read from the cache, rather than the raw network
// result. Set without setDiff to avoid triggering a notify call,
// since we have other ways of notifying for this result.
// If we're allowed to write to the cache, and we can read a
// complete result from the cache, update result.data to be the
// result from the cache, rather than the raw network result.
// Set without setDiff to avoid triggering a notify call, since
// we have other ways of notifying for this result.
_this.updateLastDiff(diff, diffOptions);
result.data = diff.result;
if (diff.complete) {
result.data = diff.result;
}
});

@@ -362,3 +378,2 @@ }

}
return result;
};

@@ -365,0 +380,0 @@ QueryInfo.prototype.markReady = function () {

@@ -66,8 +66,2 @@ import { __assign, __awaiter, __generator } from "tslib";

}
// TODO: remove before we release 3.9
Object.defineProperty(this.inFlightLinkObservables, "get", {
value: function () {
throw new Error("This version of Apollo Client requires at least @apollo/experimental-nextjs-app-support version 0.5.2.");
},
});
}

@@ -90,8 +84,8 @@ /**

QueryManager.prototype.mutate = function (_a) {
var _b, _c;
var mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, updateQueries = _a.updateQueries, _d = _a.refetchQueries, refetchQueries = _d === void 0 ? [] : _d, _e = _a.awaitRefetchQueries, awaitRefetchQueries = _e === void 0 ? false : _e, updateWithProxyFn = _a.update, onQueryUpdated = _a.onQueryUpdated, _f = _a.fetchPolicy, fetchPolicy = _f === void 0 ? ((_b = this.defaultOptions.mutate) === null || _b === void 0 ? void 0 : _b.fetchPolicy) || "network-only" : _f, _g = _a.errorPolicy, errorPolicy = _g === void 0 ? ((_c = this.defaultOptions.mutate) === null || _c === void 0 ? void 0 : _c.errorPolicy) || "none" : _g, keepRootFields = _a.keepRootFields, context = _a.context;
return __awaiter(this, void 0, void 0, function () {
return __awaiter(this, arguments, void 0, function (_b) {
var mutationId, hasClientExports, mutationStoreValue, isOptimistic, self;
return __generator(this, function (_h) {
switch (_h.label) {
var _c, _d;
var mutation = _b.mutation, variables = _b.variables, optimisticResponse = _b.optimisticResponse, updateQueries = _b.updateQueries, _e = _b.refetchQueries, refetchQueries = _e === void 0 ? [] : _e, _f = _b.awaitRefetchQueries, awaitRefetchQueries = _f === void 0 ? false : _f, updateWithProxyFn = _b.update, onQueryUpdated = _b.onQueryUpdated, _g = _b.fetchPolicy, fetchPolicy = _g === void 0 ? ((_c = this.defaultOptions.mutate) === null || _c === void 0 ? void 0 : _c.fetchPolicy) || "network-only" : _g, _h = _b.errorPolicy, errorPolicy = _h === void 0 ? ((_d = this.defaultOptions.mutate) === null || _d === void 0 ? void 0 : _d.errorPolicy) || "none" : _h, keepRootFields = _b.keepRootFields, context = _b.context;
return __generator(this, function (_j) {
switch (_j.label) {
case 0:

@@ -107,4 +101,4 @@ invariant(mutation, 26);

case 1:
variables = (_h.sent());
_h.label = 2;
variables = (_j.sent());
_j.label = 2;
case 2:

@@ -278,3 +272,3 @@ mutationStoreValue = this.mutationStore &&

if (cacheWrites.length > 0 ||
mutation.refetchQueries ||
(mutation.refetchQueries || "").length > 0 ||
mutation.update ||

@@ -773,3 +767,3 @@ mutation.onQueryUpdated ||

// ones used to obtain it from the link.
result = queryInfo.markResult(result, linkDocument, options, cacheWriteBehavior);
queryInfo.markResult(result, linkDocument, options, cacheWriteBehavior);
queryInfo.markReady();

@@ -776,0 +770,0 @@ }

@@ -44,3 +44,3 @@ import type { DocumentNode, GraphQLError } from "graphql";

export type OperationVariables = Record<string, any>;
export type ApolloQueryResult<T> = {
export interface ApolloQueryResult<T> {
data: T;

@@ -61,3 +61,3 @@ /**

partial?: boolean;
};
}
export type MutationQueryReducer<T> = (previousResult: Record<string, any>, options: {

@@ -73,2 +73,5 @@ mutationResult: FetchResult<T>;

};
/**
* @deprecated Use `MutationUpdaterFunction` instead.
*/
export type MutationUpdaterFn<T = {

@@ -75,0 +78,0 @@ [key: string]: any;

@@ -33,53 +33,97 @@ import type { DocumentNode } from "graphql";

/**
* A GraphQL document that consists of a single query to be sent down to the
* server.
* A GraphQL query string parsed into an AST with the gql template literal.
*
* @docGroup
*
* 1. Operation options
*/
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
/**
* A map going from variable name to variable value, where the variables are used
* within the GraphQL query.
* An object containing all of the GraphQL variables your query requires to execute.
*
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
*
* @docGroup
*
* 1. Operation options
*/
variables?: TVariables;
/**
* Specifies the {@link ErrorPolicy} to be used for this query
* Specifies how the query handles a response that returns both GraphQL errors and partial results.
*
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
*
* The default value is `none`, meaning that the query result includes error details but not partial results.
*
* @docGroup
*
* 1. Operation options
*/
errorPolicy?: ErrorPolicy;
/**
* Context to be passed to link execution chain
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
*
* @docGroup
*
* 2. Networking options
*/
context?: DefaultContext;
/**
* Specifies the {@link FetchPolicy} to be used for this query
* Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).
*
* For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
*
* The default value is `cache-first`.
*
* @docGroup
*
* 3. Caching options
*/
fetchPolicy?: FetchPolicy;
/**
* The time interval (in milliseconds) on which this query should be
* refetched from the server.
* Specifies the interval (in milliseconds) at which the query polls for updated results.
*
* The default value is `0` (no polling).
*
* @docGroup
*
* 2. Networking options
*/
pollInterval?: number;
/**
* Whether or not updates to the network status should trigger next on the observer of this query
* If `true`, the in-progress query's associated component re-renders whenever the network status changes or a network error occurs.
*
* The default value is `false`.
*
* @docGroup
*
* 2. Networking options
*/
notifyOnNetworkStatusChange?: boolean;
/**
* Allow returning incomplete data from the cache when a larger query cannot
* be fully satisfied by the cache, instead of returning nothing.
* If `true`, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.
*
* The default value is `false`.
*
* @docGroup
*
* 3. Caching options
*/
returnPartialData?: boolean;
/**
* If `true`, perform a query `refetch` if the query result is marked as
* being partial, and the returned data is reset to an empty Object by the
* Apollo Client `QueryManager` (due to a cache miss).
* If `true`, causes a query refetch if the query result is detected as partial.
*
* The default value is `false`.
*
* @deprecated
*
* Setting this option is unnecessary in Apollo Client 3, thanks to a more consistent application of fetch policies. It might be removed in a future release.
*/
partialRefetch?: boolean;
/**
* Whether to canonize cache results before returning them. Canonization takes some extra time, but it speeds up future deep equality comparisons. Defaults to false.
*
* @deprecated
* Using `canonizeResults` can result in memory leaks so we generally do not
* recommend using this option anymore.
* A future version of Apollo Client will contain a similar feature without
* the risk of memory leaks.
*
* Whether to canonize cache results before returning them. Canonization
* takes some extra time, but it speeds up future deep equality comparisons.
* Defaults to false.
*
* Using `canonizeResults` can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.
*/

@@ -91,77 +135,133 @@ canonizeResults?: boolean;

*/
export interface WatchQueryOptions<TVariables extends OperationVariables = OperationVariables, TData = any> {
export interface WatchQueryOptions<TVariables extends OperationVariables = OperationVariables, TData = any> extends SharedWatchQueryOptions<TVariables, TData> {
/**
* Specifies the {@link FetchPolicy} to be used for this query.
* A GraphQL query string parsed into an AST with the gql template literal.
*
* @docGroup
*
* 1. Operation options
*/
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
}
export interface SharedWatchQueryOptions<TVariables extends OperationVariables, TData> {
/**
* Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).
*
* For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
*
* The default value is `cache-first`.
*
* @docGroup
*
* 3. Caching options
*/
fetchPolicy?: WatchQueryFetchPolicy;
/**
* Specifies the {@link FetchPolicy} to be used after this query has completed.
*
* @docGroup
*
* 3. Caching options
*/
nextFetchPolicy?: WatchQueryFetchPolicy | ((this: WatchQueryOptions<TVariables, TData>, currentFetchPolicy: WatchQueryFetchPolicy, context: NextFetchPolicyContext<TData, TVariables>) => WatchQueryFetchPolicy);
/**
* Defaults to the initial value of options.fetchPolicy, but can be explicitly
* configured to specify the WatchQueryFetchPolicy to revert back to whenever
* variables change (unless nextFetchPolicy intervenes).
* Defaults to the initial value of options.fetchPolicy, but can be explicitly configured to specify the WatchQueryFetchPolicy to revert back to whenever variables change (unless nextFetchPolicy intervenes).
*
* @docGroup
*
* 3. Caching options
*/
initialFetchPolicy?: WatchQueryFetchPolicy;
/**
* Specifies whether a {@link NetworkStatus.refetch} operation should merge
* incoming field data with existing data, or overwrite the existing data.
* Overwriting is probably preferable, but merging is currently the default
* behavior, for backwards compatibility with Apollo Client 3.x.
* Specifies whether a `NetworkStatus.refetch` operation should merge incoming field data with existing data, or overwrite the existing data. Overwriting is probably preferable, but merging is currently the default behavior, for backwards compatibility with Apollo Client 3.x.
*
* @docGroup
*
* 3. Caching options
*/
refetchWritePolicy?: RefetchWritePolicy;
/**
* A GraphQL document that consists of a single query to be sent down to the server.
* An object containing all of the GraphQL variables your query requires to execute.
*
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
*
* @docGroup
*
* 1. Operation options
*/
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
/**
* A map going from variable name to variable value, where the variables are used within the GraphQL query.
*/
variables?: TVariables;
/**
* Specifies the {@link ErrorPolicy} to be used for this query
* Specifies how the query handles a response that returns both GraphQL errors and partial results.
*
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
*
* The default value is `none`, meaning that the query result includes error details but not partial results.
*
* @docGroup
*
* 1. Operation options
*/
errorPolicy?: ErrorPolicy;
/**
* Context to be passed to link execution chain
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
*
* @docGroup
*
* 2. Networking options
*/
context?: DefaultContext;
/**
* The time interval (in milliseconds) on which this query should be refetched from the server.
* Specifies the interval (in milliseconds) at which the query polls for updated results.
*
* The default value is `0` (no polling).
*
* @docGroup
*
* 2. Networking options
*/
pollInterval?: number;
/**
* Whether or not updates to the network status should trigger next on the observer of this query
* If `true`, the in-progress query's associated component re-renders whenever the network status changes or a network error occurs.
*
* The default value is `false`.
*
* @docGroup
*
* 2. Networking options
*/
notifyOnNetworkStatusChange?: boolean;
/**
* Allow returning incomplete data from the cache when a larger query cannot be fully satisfied by the cache, instead of returning nothing.
* If `true`, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.
*
* The default value is `false`.
*
* @docGroup
*
* 3. Caching options
*/
returnPartialData?: boolean;
/**
* If `true`, perform a query `refetch` if the query result is marked as being partial, and the returned data is reset to an empty Object by the Apollo Client `QueryManager` (due to a cache miss).
* If `true`, causes a query refetch if the query result is detected as partial.
*
* The default value is `false`.
*
* @deprecated
*
* Setting this option is unnecessary in Apollo Client 3, thanks to a more consistent application of fetch policies. It might be removed in a future release.
*/
partialRefetch?: boolean;
/**
* Whether to canonize cache results before returning them. Canonization takes some extra time, but it speeds up future deep equality comparisons. Defaults to false.
*
* @deprecated
*
*
* Using `canonizeResults` can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.
*
* Whether to canonize cache results before returning them. Canonization takes some extra time, but it speeds up future deep equality comparisons. Defaults to false.
*/
canonizeResults?: boolean;
/**
* A callback function that's called whenever a refetch attempt occurs
* while polling. If the function returns `true`, the refetch is
* skipped and not reattempted until the next poll interval.
* A callback function that's called whenever a refetch attempt occurs while polling. If the function returns `true`, the refetch is skipped and not reattempted until the next poll interval.
*
* @docGroup
*
* 2. Networking options
*/

@@ -177,3 +277,19 @@ skipPollAttempt?: () => boolean;

export interface FetchMoreQueryOptions<TVariables, TData = any> {
/**
* A GraphQL query string parsed into an AST with the gql template literal.
*
* @docGroup
*
* 1. Operation options
*/
query?: DocumentNode | TypedDocumentNode<TData, TVariables>;
/**
* An object containing all of the GraphQL variables your query requires to execute.
*
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
*
* @docGroup
*
* 1. Operation options
*/
variables?: Partial<TVariables>;

@@ -197,13 +313,11 @@ context?: DefaultContext;

/**
* A GraphQL document, often created with `gql` from the `graphql-tag`
* package, that contains a single subscription inside of it.
* A GraphQL document, often created with `gql` from the `graphql-tag` package, that contains a single subscription inside of it.
*/
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
/**
* An object that maps from the name of a variable as used in the subscription
* GraphQL document to that variable's value.
* An object containing all of the variables your subscription needs to execute
*/
variables?: TVariables;
/**
* Specifies the {@link FetchPolicy} to be used for this subscription.
* How you want your component to interact with the Apollo cache. For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
*/

@@ -216,3 +330,3 @@ fetchPolicy?: FetchPolicy;

/**
* Context object to be passed through the link execution chain.
* Shared context between your component and your network interface (Apollo Link).
*/

@@ -223,7 +337,9 @@ context?: DefaultContext;

/**
* An object that represents the result of this mutation that will be
* optimistically stored before the server has actually returned a result.
* This is most often used for optimistic UI, where we want to be able to see
* the result of a mutation immediately, and update the UI later if any errors
* appear.
* By providing either an object or a callback function that, when invoked after a mutation, allows you to return optimistic data and optionally skip updates via the `IGNORE` sentinel object, Apollo Client caches this temporary (and potentially incorrect) response until the mutation completes, enabling more responsive UI updates.
*
* For more information, see [Optimistic mutation results](https://www.apollographql.com/docs/react/performance/optimistic-ui/).
*
* @docGroup
*
* 3. Caching options
*/

@@ -234,91 +350,105 @@ optimisticResponse?: TData | ((vars: TVariables, { IGNORE }: {

/**
* A {@link MutationQueryReducersMap}, which is map from query names to
* mutation query reducers. Briefly, this map defines how to incorporate the
* results of the mutation into the results of queries that are currently
* being watched by your application.
* A {@link MutationQueryReducersMap}, which is map from query names to mutation query reducers. Briefly, this map defines how to incorporate the results of the mutation into the results of queries that are currently being watched by your application.
*/
updateQueries?: MutationQueryReducersMap<TData>;
/**
* A list of query names which will be refetched once this mutation has
* returned. This is often used if you have a set of queries which may be
* affected by a mutation and will have to update. Rather than writing a
* mutation query reducer (i.e. `updateQueries`) for this, you can simply
* refetch the queries that will be affected and achieve a consistent store
* once these queries return.
* An array (or a function that _returns_ an array) that specifies which queries you want to refetch after the mutation occurs.
*
* Each array value can be either:
*
* - An object containing the `query` to execute, along with any `variables`
*
* - A string indicating the operation name of the query to refetch
*
* @docGroup
*
* 1. Operation options
*/
refetchQueries?: ((result: FetchResult<TData>) => InternalRefetchQueriesInclude) | InternalRefetchQueriesInclude;
/**
* By default, `refetchQueries` does not wait for the refetched queries to
* be completed, before resolving the mutation `Promise`. This ensures that
* query refetching does not hold up mutation response handling (query
* refetching is handled asynchronously). Set `awaitRefetchQueries` to
* `true` if you would like to wait for the refetched queries to complete,
* before the mutation can be marked as resolved.
* If `true`, makes sure all queries included in `refetchQueries` are completed before the mutation is considered complete.
*
* The default value is `false` (queries are refetched asynchronously).
*
* @docGroup
*
* 1. Operation options
*/
awaitRefetchQueries?: boolean;
/**
* A function which provides an {@link ApolloCache} instance, and the result
* of the mutation, to allow the user to update the store based on the
* results of the mutation.
*
* This function will be called twice over the lifecycle of a mutation. Once
* at the very beginning if an `optimisticResponse` was provided. The writes
* created from the optimistic data will be rolled back before the second time
* this function is called which is when the mutation has successfully
* resolved. At that point `update` will be called with the *actual* mutation
* result and those writes will not be rolled back.
*
* Note that since this function is intended to be used to update the
* store, it cannot be used with a `no-cache` fetch policy. If you're
* interested in performing some action after a mutation has completed,
* and you don't need to update the store, use the Promise returned from
* `client.mutate` instead.
* A function used to update the Apollo Client cache after the mutation completes.
*
* For more information, see [Updating the cache after a mutation](https://www.apollographql.com/docs/react/data/mutations#updating-the-cache-after-a-mutation).
*
* @docGroup
*
* 3. Caching options
*/
update?: MutationUpdaterFunction<TData, TVariables, TContext, TCache>;
/**
* A function that will be called for each ObservableQuery affected by
* this mutation, after the mutation has completed.
* Optional callback for intercepting queries whose cache data has been updated by the mutation, as well as any queries specified in the `refetchQueries: [...]` list passed to `client.mutate`.
*
* Returning a `Promise` from `onQueryUpdated` will cause the final mutation `Promise` to await the returned `Promise`. Returning `false` causes the query to be ignored.
*
* @docGroup
*
* 1. Operation options
*/
onQueryUpdated?: OnQueryUpdated<any>;
/**
* Specifies the {@link ErrorPolicy} to be used for this operation
* Specifies how the mutation handles a response that returns both GraphQL errors and partial results.
*
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
*
* The default value is `none`, meaning that the mutation result includes error details but _not_ partial results.
*
* @docGroup
*
* 1. Operation options
*/
errorPolicy?: ErrorPolicy;
/**
* An object that maps from the name of a variable as used in the mutation
* GraphQL document to that variable's value.
* An object containing all of the GraphQL variables your mutation requires to execute.
*
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
*
* @docGroup
*
* 1. Operation options
*/
variables?: TVariables;
/**
* The context to be passed to the link execution chain. This context will
* only be used with this mutation. It will not be used with
* `refetchQueries`. Refetched queries use the context they were
* initialized with (since the initial context is stored as part of the
* `ObservableQuery` instance). If a specific context is needed when
* refetching queries, make sure it is configured (via the
* [query `context` option](https://www.apollographql.com/docs/react/api/apollo-client#ApolloClient.query))
* when the query is first initialized/run.
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
*
* @docGroup
*
* 2. Networking options
*/
context?: TContext;
}
export interface MutationOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationBaseOptions<TData, TVariables, TContext, TCache> {
export interface MutationOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationSharedOptions<TData, TVariables, TContext, TCache> {
/**
* A GraphQL document, often created with `gql` from the `graphql-tag`
* package, that contains a single mutation inside of it.
* A GraphQL document, often created with `gql` from the `graphql-tag` package, that contains a single mutation inside of it.
*
* @docGroup
*
* 1. Operation options
*/
mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;
}
export interface MutationSharedOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationBaseOptions<TData, TVariables, TContext, TCache> {
/**
* Specifies the {@link MutationFetchPolicy} to be used for this query.
* Mutations support only 'network-only' and 'no-cache' fetchPolicy strings.
* If fetchPolicy is not provided, it defaults to 'network-only'.
* Provide `no-cache` if the mutation's result should _not_ be written to the Apollo Client cache.
*
* The default value is `network-only` (which means the result _is_ written to the cache).
*
* Unlike queries, mutations _do not_ support [fetch policies](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy) besides `network-only` and `no-cache`.
*
* @docGroup
*
* 3. Caching options
*/
fetchPolicy?: MutationFetchPolicy;
/**
* To avoid retaining sensitive information from mutation root field
* arguments, Apollo Client v3.4+ automatically clears any `ROOT_MUTATION`
* fields from the cache after each mutation finishes. If you need this
* information to remain in the cache, you can prevent the removal by passing
* `keepRootFields: true` to the mutation. `ROOT_MUTATION` result data are
* also passed to the mutation `update` function, so we recommend obtaining
* the results that way, rather than using this option, if possible.
* To avoid retaining sensitive information from mutation root field arguments, Apollo Client v3.4+ automatically clears any `ROOT_MUTATION` fields from the cache after each mutation finishes. If you need this information to remain in the cache, you can prevent the removal by passing `keepRootFields: true` to the mutation. `ROOT_MUTATION` result data are also passed to the mutation `update` function, so we recommend obtaining the results that way, rather than using this option, if possible.
*/

@@ -325,0 +455,0 @@ keepRootFields?: boolean;

@@ -352,3 +352,3 @@ 'use strict';

file: "@apollo/client/cache/inmemory/writeToStore.js",
message: "Cache data may be lost when replacing the %s field of a %s object.\n\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\n\nTo address this problem (which is not a bug in Apollo Client), %sdefine a custom merge function for the %s field, so InMemoryCache can safely merge these objects:\n\n existing: %s\n incoming: %s\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"
message: "Cache data may be lost when replacing the %s field of a %s object.\n\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\n\nTo address this problem (which is not a bug in Apollo Client), %sdefine a custom merge function for the %s field, so InMemoryCache can safely merge these objects:\n\n existing: %o\n incoming: %o\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"
},

@@ -365,3 +365,3 @@ 20: {

file: "@apollo/client/core/QueryManager.js",
message: "Unknown query %s requested in refetchQueries options.include array"
message: "Unknown query %o requested in refetchQueries options.include array"
},

@@ -433,3 +433,3 @@ 35: {

var version = "0.0.0-pr-11465-20240125173354";
var version = "0.0.0-pr-11465-20240315183534";

@@ -436,0 +436,0 @@ function maybe(thunk) {

@@ -432,3 +432,3 @@ export const errorCodes = // This file is used by the error message display website and the

file: "@apollo/client/cache/inmemory/writeToStore.js",
message: "Cache data may be lost when replacing the %s field of a %s object.\n\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\n\nTo address this problem (which is not a bug in Apollo Client), %sdefine a custom merge function for the %s field, so InMemoryCache can safely merge these objects:\n\n existing: %s\n incoming: %s\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"
message: "Cache data may be lost when replacing the %s field of a %s object.\n\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\n\nTo address this problem (which is not a bug in Apollo Client), %sdefine a custom merge function for the %s field, so InMemoryCache can safely merge these objects:\n\n existing: %o\n incoming: %o\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"
},

@@ -448,3 +448,3 @@

file: "@apollo/client/core/QueryManager.js",
message: "Unknown query %s requested in refetchQueries options.include array"
message: "Unknown query %o requested in refetchQueries options.include array"
},

@@ -451,0 +451,0 @@

@@ -184,6 +184,6 @@ 'use strict';

function readMultipartBody(response, nextValue) {
var _a;
return tslib.__awaiter(this, void 0, void 0, function () {
var decoder, contentType, delimiter, boundaryVal, boundary, buffer, iterator, running, _b, value, done, chunk, searchFrom, bi, message, i, headers, contentType_1, body, result, next;
var _c, _d;
var decoder, contentType, delimiter, boundaryVal, boundary, buffer, iterator, running, _a, value, done, chunk, searchFrom, bi, message, i, headers, contentType_1, body, result, next;
var _b, _c;
var _d;
return tslib.__generator(this, function (_e) {

@@ -196,3 +196,3 @@ switch (_e.label) {

decoder = new TextDecoder("utf-8");
contentType = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get("content-type");
contentType = (_d = response.headers) === null || _d === void 0 ? void 0 : _d.get("content-type");
delimiter = "boundary=";

@@ -211,3 +211,3 @@ boundaryVal = (contentType === null || contentType === void 0 ? void 0 : contentType.includes(delimiter)) ?

case 2:
_b = _e.sent(), value = _b.value, done = _b.done;
_a = _e.sent(), value = _a.value, done = _a.done;
chunk = typeof value === "string" ? value : decoder.decode(value);

@@ -220,6 +220,6 @@ searchFrom = buffer.length - boundary.length + 1;

message = void 0;
_c = [
_b = [
buffer.slice(0, bi),
buffer.slice(bi + boundary.length),
], message = _c[0], buffer = _c[1];
], message = _b[0], buffer = _b[1];
i = message.indexOf("\r\n\r\n");

@@ -243,6 +243,9 @@ headers = parseHeaders(message.slice(0, i));

if ("payload" in result) {
if (Object.keys(result).length === 1 && result.payload === null) {
return [2 ];
}
next = tslib.__assign({}, result.payload);
}
if ("errors" in result) {
next = tslib.__assign(tslib.__assign({}, next), { extensions: tslib.__assign(tslib.__assign({}, ("extensions" in next ? next.extensions : null)), (_d = {}, _d[errors.PROTOCOL_ERRORS_SYMBOL] = result.errors, _d)) });
next = tslib.__assign(tslib.__assign({}, next), { extensions: tslib.__assign(tslib.__assign({}, ("extensions" in next ? next.extensions : null)), (_c = {}, _c[errors.PROTOCOL_ERRORS_SYMBOL] = result.errors, _c)) });
}

@@ -249,0 +252,0 @@ nextValue(next);

@@ -8,6 +8,6 @@ import { __assign, __awaiter, __generator } from "tslib";

export function readMultipartBody(response, nextValue) {
var _a;
return __awaiter(this, void 0, void 0, function () {
var decoder, contentType, delimiter, boundaryVal, boundary, buffer, iterator, running, _b, value, done, chunk, searchFrom, bi, message, i, headers, contentType_1, body, result, next;
var _c, _d;
var decoder, contentType, delimiter, boundaryVal, boundary, buffer, iterator, running, _a, value, done, chunk, searchFrom, bi, message, i, headers, contentType_1, body, result, next;
var _b, _c;
var _d;
return __generator(this, function (_e) {

@@ -20,3 +20,3 @@ switch (_e.label) {

decoder = new TextDecoder("utf-8");
contentType = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get("content-type");
contentType = (_d = response.headers) === null || _d === void 0 ? void 0 : _d.get("content-type");
delimiter = "boundary=";

@@ -35,3 +35,3 @@ boundaryVal = (contentType === null || contentType === void 0 ? void 0 : contentType.includes(delimiter)) ?

case 2:
_b = _e.sent(), value = _b.value, done = _b.done;
_a = _e.sent(), value = _a.value, done = _a.done;
chunk = typeof value === "string" ? value : decoder.decode(value);

@@ -44,6 +44,6 @@ searchFrom = buffer.length - boundary.length + 1;

message = void 0;
_c = [
_b = [
buffer.slice(0, bi),
buffer.slice(bi + boundary.length),
], message = _c[0], buffer = _c[1];
], message = _b[0], buffer = _b[1];
i = message.indexOf("\r\n\r\n");

@@ -67,6 +67,9 @@ headers = parseHeaders(message.slice(0, i));

if ("payload" in result) {
if (Object.keys(result).length === 1 && result.payload === null) {
return [2 /*return*/];
}
next = __assign({}, result.payload);
}
if ("errors" in result) {
next = __assign(__assign({}, next), { extensions: __assign(__assign({}, ("extensions" in next ? next.extensions : null)), (_d = {}, _d[PROTOCOL_ERRORS_SYMBOL] = result.errors, _d)) });
next = __assign(__assign({}, next), { extensions: __assign(__assign({}, ("extensions" in next ? next.extensions : null)), (_c = {}, _c[PROTOCOL_ERRORS_SYMBOL] = result.errors, _c)) });
}

@@ -73,0 +76,0 @@ nextValue(next);

{
"name": "@apollo/client",
"version": "0.0.0-pr-11465-20240125173354",
"version": "0.0.0-pr-11465-20240315183534",
"description": "A fully-featured caching GraphQL client.",

@@ -62,3 +62,3 @@ "private": false,

"prop-types": "^15.7.2",
"rehackt": "0.0.3",
"rehackt": "0.0.6",
"response-iterator": "^0.2.6",

@@ -71,13 +71,13 @@ "symbol-observable": "^4.0.0",

"devDependencies": {
"@arethetypeswrong/cli": "0.13.5",
"@babel/parser": "7.23.6",
"@arethetypeswrong/cli": "0.15.1",
"@babel/parser": "7.24.0",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.1",
"@graphql-tools/schema": "10.0.2",
"@microsoft/api-extractor": "7.39.1",
"@graphql-tools/schema": "10.0.3",
"@microsoft/api-extractor": "7.42.3",
"@rollup/plugin-node-resolve": "11.2.1",
"@size-limit/esbuild-why": "11.0.1",
"@size-limit/preset-small-lib": "11.0.1",
"@testing-library/jest-dom": "6.2.0",
"@testing-library/react": "14.1.2",
"@size-limit/esbuild-why": "11.0.2",
"@size-limit/preset-small-lib": "11.0.2",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/react": "14.2.1",
"@testing-library/react-12": "npm:@testing-library/react@^12",

@@ -90,15 +90,15 @@ "@testing-library/user-event": "14.5.2",

"@types/hoist-non-react-statics": "3.3.5",
"@types/jest": "29.5.11",
"@types/jest": "29.5.12",
"@types/lodash": "4.14.202",
"@types/node": "20.10.7",
"@types/node-fetch": "2.6.10",
"@types/react": "18.2.47",
"@types/react-dom": "18.2.18",
"@types/relay-runtime": "14.1.14",
"@types/node": "20.11.25",
"@types/node-fetch": "2.6.11",
"@types/react": "18.2.64",
"@types/react-dom": "18.2.21",
"@types/relay-runtime": "14.1.23",
"@types/use-sync-external-store": "0.0.6",
"@typescript-eslint/eslint-plugin": "6.18.0",
"@typescript-eslint/parser": "6.18.0",
"@typescript-eslint/rule-tester": "6.18.0",
"@typescript-eslint/types": "6.18.0",
"@typescript-eslint/utils": "6.18.0",
"@typescript-eslint/eslint-plugin": "7.1.1",
"@typescript-eslint/parser": "7.1.1",
"@typescript-eslint/rule-tester": "7.1.1",
"@typescript-eslint/types": "7.1.1",
"@typescript-eslint/utils": "7.1.1",
"acorn": "8.11.3",

@@ -108,3 +108,3 @@ "blob-polyfill": "7.0.20220408",

"cross-fetch": "4.0.0",
"eslint": "8.56.0",
"eslint": "8.57.0",
"eslint-import-resolver-typescript": "3.6.1",

@@ -114,7 +114,7 @@ "eslint-plugin-import": "npm:@phryneas/eslint-plugin-import@2.27.5-pr.2813.2817.199971c",

"eslint-plugin-testing-library": "6.2.0",
"expect-type": "0.17.3",
"expect-type": "0.18.0",
"fetch-mock": "9.11.0",
"glob": "8.1.0",
"graphql": "16.8.1",
"graphql-ws": "5.14.3",
"graphql-ws": "5.15.0",
"jest": "29.7.0",

@@ -130,4 +130,4 @@ "jest-environment-jsdom": "29.7.0",

"react-dom-17": "npm:react-dom@^17",
"react-error-boundary": "4.0.12",
"recast": "0.23.4",
"react-error-boundary": "4.0.13",
"recast": "0.23.6",
"resolve": "1.22.8",

@@ -139,7 +139,7 @@ "rimraf": "5.0.5",

"rxjs": "7.8.1",
"size-limit": "11.0.1",
"size-limit": "11.0.2",
"subscriptions-transport-ws": "0.11.0",
"terser": "5.26.0",
"ts-api-utils": "1.0.3",
"ts-jest": "29.1.1",
"terser": "5.29.1",
"ts-api-utils": "1.3.0",
"ts-jest": "29.1.2",
"ts-jest-resolver": "2.0.1",

@@ -149,5 +149,5 @@ "ts-morph": "21.0.1",

"typedoc": "0.25.0",
"typescript": "5.3.3",
"typescript": "5.4.2",
"wait-for-observables": "1.0.3",
"web-streams-polyfill": "3.3.2",
"web-streams-polyfill": "3.3.3",
"whatwg-fetch": "3.6.20"

@@ -154,0 +154,0 @@ },

@@ -15,2 +15,5 @@ import type { DocumentNode } from "graphql";

export interface SubscriptionComponentOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends BaseSubscriptionOptions<TData, TVariables> {
/**
* A GraphQL document, often created with `gql` from the `graphql-tag` package, that contains a single subscription inside of it.
*/
subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;

@@ -17,0 +20,0 @@ children?: null | ((result: SubscriptionResult<TData>) => ReactTypes.JSX.Element | null);

@@ -10,10 +10,11 @@ 'use strict';

var utilities = require('../../utilities');
var equality = require('@wry/equality');
var equal = require('@wry/equality');
var errors = require('../../errors');
var core = require('../../core');
var parser = require('../parser');
var React$1 = require('react');
var internal = require('../internal');
var cache = require('../../cache');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
function _interopNamespace(e) {

@@ -32,3 +33,3 @@ if (e && e.__esModule) return e;

var React__namespace = /*#__PURE__*/_interopNamespace(React);
var React__namespace$1 = /*#__PURE__*/_interopNamespace(React$1);
var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);

@@ -91,5 +92,51 @@ function useApolloClient(override) {

function useDeepMemo(memoFn, deps) {
var ref = React__namespace.useRef();
if (!ref.current || !equal.equal(ref.current.deps, deps)) {
ref.current = { value: memoFn(), deps: deps };
}
return ref.current.value;
}
function getRenderDispatcher() {
var _a, _b;
return (_b = (_a = React__namespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentDispatcher) === null || _b === void 0 ? void 0 : _b.current;
}
var RenderDispatcher = null;
function useRenderGuard() {
RenderDispatcher = getRenderDispatcher();
return React__namespace.useCallback(function () {
return (RenderDispatcher != null && RenderDispatcher === getRenderDispatcher());
}, []);
}
var useKey = "use";
var realHook = React__namespace[useKey];
var __use = realHook ||
function __use(promise) {
var statefulPromise = utilities.wrapPromiseWithState(promise);
switch (statefulPromise.status) {
case "pending":
throw statefulPromise;
case "rejected":
throw statefulPromise.reason;
case "fulfilled":
return statefulPromise.value;
}
};
var wrapperSymbol = Symbol.for("apollo.hook.wrappers");
function wrapHook(hookName, useHook, clientOrObsQuery) {
var queryManager = clientOrObsQuery["queryManager"];
var wrappers = queryManager && queryManager[wrapperSymbol];
var wrapper = wrappers && wrappers[hookName];
return wrapper ? wrapper(useHook) : useHook;
}
var hasOwnProperty = Object.prototype.hasOwnProperty;
function useQuery(query, options) {
if (options === void 0) { options = Object.create(null); }
return wrapHook("useQuery", _useQuery, useApolloClient(options && options.client))(query, options);
}
function _useQuery(query, options) {
return useInternalState(useApolloClient(options.client), query).useQuery(options);

@@ -179,3 +226,3 @@ }

previousResult.networkStatus === result.networkStatus &&
equality.equal(previousResult.data, result.data)) {
equal.equal(previousResult.data, result.data)) {
return;

@@ -194,3 +241,3 @@ }

(previousResult && previousResult.loading) ||
!equality.equal(error, previousResult.error)) {
!equal.equal(error, previousResult.error)) {
_this.setResult({

@@ -221,3 +268,3 @@ data: (previousResult && previousResult.data),

var currentWatchQueryOptions = this.watchQueryOptions;
if (!equality.equal(watchQueryOptions, currentWatchQueryOptions)) {
if (!equal.equal(watchQueryOptions, currentWatchQueryOptions)) {
this.watchQueryOptions = watchQueryOptions;

@@ -400,3 +447,3 @@ if (currentWatchQueryOptions && this.observable) {

var document = (_a = merged === null || merged === void 0 ? void 0 : merged.query) !== null && _a !== void 0 ? _a : query;
optionsRef.current = merged;
optionsRef.current = options;
queryRef.current = document;

@@ -502,3 +549,3 @@ var internalState = useInternalState(useApolloClient(options && options.client), document);

};
if (ref.current.isMounted && !equality.equal(ref.current.result, result_1)) {
if (ref.current.isMounted && !equal.equal(ref.current.result, result_1)) {
setResult((ref.current.result = result_1));

@@ -523,3 +570,3 @@ }

};
if (!equality.equal(ref.current.result, result_2)) {
if (!equal.equal(ref.current.result, result_2)) {
setResult((ref.current.result = result_2));

@@ -613,3 +660,3 @@ }

!(options === null || options === void 0 ? void 0 : options.skip) !== !((_c = ref.current.options) === null || _c === void 0 ? void 0 : _c.skip) ||
!equality.equal(options === null || options === void 0 ? void 0 : options.variables, (_d = ref.current.options) === null || _d === void 0 ? void 0 : _d.variables))) ||
!equal.equal(options === null || options === void 0 ? void 0 : options.variables, (_d = ref.current.options) === null || _d === void 0 ? void 0 : _d.variables))) ||
canResetObservableRef.current) {

@@ -706,48 +753,7 @@ setResult({

function useDeepMemo(memoFn, deps) {
var ref = React__namespace.useRef();
if (!ref.current || !equality.equal(ref.current.deps, deps)) {
ref.current = { value: memoFn(), deps: deps };
}
return ref.current.value;
function useFragment(options) {
return wrapHook("useFragment", _useFragment, useApolloClient(options.client))(options);
}
function getRenderDispatcher() {
var _a, _b;
return (_b = (_a = React__namespace.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _a === void 0 ? void 0 : _a.ReactCurrentDispatcher) === null || _b === void 0 ? void 0 : _b.current;
}
var RenderDispatcher = null;
function useRenderGuard() {
RenderDispatcher = getRenderDispatcher();
return React__namespace.useCallback(function () {
return (RenderDispatcher !== null && RenderDispatcher === getRenderDispatcher());
}, []);
}
var INIT = {};
function useLazyRef(getInitialValue) {
var ref = React__namespace$1.useRef(INIT);
if (ref.current === INIT) {
ref.current = getInitialValue();
}
return ref;
}
var useKey = "use";
var realHook = React__namespace[useKey];
var __use = realHook ||
function __use(promise) {
var statefulPromise = utilities.wrapPromiseWithState(promise);
switch (statefulPromise.status) {
case "pending":
throw statefulPromise;
case "rejected":
throw statefulPromise.reason;
case "fulfilled":
return statefulPromise.value;
}
};
function useFragment(options) {
var cache = useApolloClient().cache;
function _useFragment(options) {
var cache = useApolloClient(options.client).cache;
var diffOptions = useDeepMemo(function () {

@@ -757,5 +763,3 @@ var fragment = options.fragment, fragmentName = options.fragmentName, from = options.from, _a = options.optimistic, optimistic = _a === void 0 ? true : _a, rest = tslib.__rest(options, ["fragment", "fragmentName", "from", "optimistic"]);

}, [options]);
var resultRef = useLazyRef(function () {
return diffToResult(cache.diff(diffOptions));
});
var resultRef = React__namespace.useRef(diffToResult(cache.diff(diffOptions)));
React__namespace.useMemo(function () {

@@ -769,2 +773,4 @@ resultRef.current = diffToResult(cache.diff(diffOptions));

next: function (result) {
if (equal__default(result, resultRef.current))
return;
resultRef.current = result;

@@ -796,2 +802,5 @@ clearTimeout(lastTimeout);

if (options === void 0) { options = Object.create(null); }
return wrapHook("useSuspenseQuery", _useSuspenseQuery, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
}
function _useSuspenseQuery(query, options) {
var client = useApolloClient(options.client);

@@ -914,2 +923,5 @@ var suspenseCache = internal.getSuspenseCache(client);

if (options === void 0) { options = Object.create(null); }
return wrapHook("useBackgroundQuery", _useBackgroundQuery, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
}
function _useBackgroundQuery(query, options) {
var client = useApolloClient(options.client);

@@ -1029,2 +1041,5 @@ var suspenseCache = internal.getSuspenseCache(client);

function useReadQuery(queryRef) {
return wrapHook("useReadQuery", _useReadQuery, internal.unwrapQueryRef(queryRef)["observable"])(queryRef);
}
function _useReadQuery(queryRef) {
var internalQueryRef = React__namespace.useMemo(function () { return internal.unwrapQueryRef(queryRef); }, [queryRef]);

@@ -1031,0 +1046,0 @@ var getPromise = React__namespace.useCallback(function () { return internal.getWrappedPromise(queryRef); }, [queryRef]);

@@ -6,2 +6,3 @@ export { useDeepMemo } from "./useDeepMemo.js";

export { __use } from "./__use.js";
export { wrapHook } from "./wrapHook.js";
//# sourceMappingURL=index.d.ts.map

@@ -7,2 +7,3 @@ // These hooks are used internally and are not exported publicly by the library

export { __use } from "./__use.js";
export { wrapHook } from "./wrapHook.js";
//# sourceMappingURL=index.js.map

@@ -1,3 +0,4 @@

import * as React from "react";
/// <reference types="react" />
import * as React from "rehackt";
export declare function useLazyRef<T>(getInitialValue: () => T): React.MutableRefObject<T>;
//# sourceMappingURL=useLazyRef.d.ts.map

@@ -1,2 +0,2 @@

import * as React from "react";
import * as React from "rehackt";
var INIT = {};

@@ -3,0 +3,0 @@ export function useLazyRef(getInitialValue) {

@@ -14,5 +14,5 @@ import * as React from "rehackt";

return React.useCallback(function () {
return (RenderDispatcher !== null && RenderDispatcher === getRenderDispatcher());
return (RenderDispatcher != null && RenderDispatcher === getRenderDispatcher());
}, []);
}
//# sourceMappingURL=useRenderGuard.js.map
import type { ApolloClient } from "../../core/index.js";
/**
* @example
* ```jsx
* import { useApolloClient } from '@apollo/client';
*
* function SomeComponent() {
* const client = useApolloClient();
* // `client` is now set to the `ApolloClient` instance being used by the
* // application (that was configured using something like `ApolloProvider`)
* }
* ```
*
* @since 3.0.0
* @returns The `ApolloClient` instance being used by the application.
*/
export declare function useApolloClient(override?: ApolloClient<object>): ApolloClient<object>;
//# sourceMappingURL=useApolloClient.d.ts.map
import { invariant } from "../../utilities/globals/index.js";
import * as React from "rehackt";
import { getApolloContext } from "../context/index.js";
/**
* @example
* ```jsx
* import { useApolloClient } from '@apollo/client';
*
* function SomeComponent() {
* const client = useApolloClient();
* // `client` is now set to the `ApolloClient` instance being used by the
* // application (that was configured using something like `ApolloProvider`)
* }
* ```
*
* @since 3.0.0
* @returns The `ApolloClient` instance being used by the application.
*/
export function useApolloClient(override) {

@@ -5,0 +20,0 @@ var context = React.useContext(getApolloContext());

@@ -5,2 +5,3 @@ import { __spreadArray } from "tslib";

import { getSuspenseCache, unwrapQueryRef, updateWrappedQueryRef, wrapQueryRef, } from "../internal/index.js";
import { wrapHook } from "./internal/index.js";
import { useWatchQueryOptions } from "./useSuspenseQuery.js";

@@ -10,2 +11,5 @@ import { canonicalStringify } from "../../cache/index.js";

if (options === void 0) { options = Object.create(null); }
return wrapHook("useBackgroundQuery", _useBackgroundQuery, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
}
function _useBackgroundQuery(query, options) {
var client = useApolloClient(options.client);

@@ -12,0 +16,0 @@ var suspenseCache = getSuspenseCache(client);

import type { DeepPartial } from "../../utilities/index.js";
import type { Cache, Reference, StoreObject, MissingTree } from "../../cache/index.js";
import type { OperationVariables } from "../../core/index.js";
import type { ApolloClient, OperationVariables } from "../../core/index.js";
import type { NoInfer } from "../types/types.js";

@@ -8,2 +8,11 @@ export interface UseFragmentOptions<TData, TVars> extends Omit<Cache.DiffOptions<NoInfer<TData>, NoInfer<TVars>>, "id" | "query" | "optimistic" | "previousResult" | "returnPartialData">, Omit<Cache.ReadFragmentOptions<TData, TVars>, "id" | "variables" | "returnPartialData"> {

optimistic?: boolean;
/**
* The instance of {@link ApolloClient} to use to look up the fragment.
*
* By default, the instance that's passed down via context is used, but you
* can provide a different instance here.
*
* @docGroup 1. Operation options
*/
client?: ApolloClient<any>;
}

@@ -10,0 +19,0 @@ export type UseFragmentResult<TData> = {

@@ -6,5 +6,9 @@ import { __assign, __rest } from "tslib";

import { useSyncExternalStore } from "./useSyncExternalStore.js";
import { useDeepMemo, useLazyRef } from "./internal/index.js";
import { useDeepMemo, wrapHook } from "./internal/index.js";
import equal from "@wry/equality";
export function useFragment(options) {
var cache = useApolloClient().cache;
return wrapHook("useFragment", _useFragment, useApolloClient(options.client))(options);
}
function _useFragment(options) {
var cache = useApolloClient(options.client).cache;
var diffOptions = useDeepMemo(function () {

@@ -14,8 +18,5 @@ var fragment = options.fragment, fragmentName = options.fragmentName, from = options.from, _a = options.optimistic, optimistic = _a === void 0 ? true : _a, rest = __rest(options, ["fragment", "fragmentName", "from", "optimistic"]);

}, [options]);
// TODO: use regular useRef here and set the value inside of useMemo
var resultRef = useLazyRef(function () {
return diffToResult(cache.diff(diffOptions));
});
// explain the timing issue: since next is async, we need to make sure that we
// get the correct diff on next render given new diffOptions
var resultRef = React.useRef(diffToResult(cache.diff(diffOptions)));
// Since .next is async, we need to make sure that we
// get the correct diff on the next render given new diffOptions
React.useMemo(function () {

@@ -30,2 +31,4 @@ resultRef.current = diffToResult(cache.diff(diffOptions));

next: function (result) {
if (equal(result, resultRef.current))
return;
resultRef.current = result;

@@ -32,0 +35,0 @@ // If we get another update before we've re-rendered, bail out of

@@ -5,3 +5,38 @@ import type { DocumentNode } from "graphql";

import type { LazyQueryHookOptions, LazyQueryResultTuple, NoInfer } from "../types/types.js";
/**
* A hook for imperatively executing queries in an Apollo application, e.g. in response to user interaction.
*
* > Refer to the [Queries - Manual execution with useLazyQuery](https://www.apollographql.com/docs/react/data/queries#manual-execution-with-uselazyquery) section for a more in-depth overview of `useLazyQuery`.
*
* @example
* ```jsx
* import { gql, useLazyQuery } from "@apollo/client";
*
* const GET_GREETING = gql`
* query GetGreeting($language: String!) {
* greeting(language: $language) {
* message
* }
* }
* `;
*
* function Hello() {
* const [loadGreeting, { called, loading, data }] = useLazyQuery(
* GET_GREETING,
* { variables: { language: "english" } }
* );
* if (called && loading) return <p>Loading ...</p>
* if (!called) {
* return <button onClick={() => loadGreeting()}>Load greeting</button>
* }
* return <h1>Hello {data.greeting.message}!</h1>;
* }
* ```
* @since 3.0.0
*
* @param query - A GraphQL query document parsed into an AST by `gql`.
* @param options - Default options to control how the query is executed.
* @returns A tuple in the form of `[execute, result]`
*/
export declare function useLazyQuery<TData = any, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: LazyQueryHookOptions<NoInfer<TData>, NoInfer<TVariables>>): LazyQueryResultTuple<TData, TVariables>;
//# sourceMappingURL=useLazyQuery.d.ts.map

@@ -16,2 +16,37 @@ import { __assign } from "tslib";

];
/**
* A hook for imperatively executing queries in an Apollo application, e.g. in response to user interaction.
*
* > Refer to the [Queries - Manual execution with useLazyQuery](https://www.apollographql.com/docs/react/data/queries#manual-execution-with-uselazyquery) section for a more in-depth overview of `useLazyQuery`.
*
* @example
* ```jsx
* import { gql, useLazyQuery } from "@apollo/client";
*
* const GET_GREETING = gql`
* query GetGreeting($language: String!) {
* greeting(language: $language) {
* message
* }
* }
* `;
*
* function Hello() {
* const [loadGreeting, { called, loading, data }] = useLazyQuery(
* GET_GREETING,
* { variables: { language: "english" } }
* );
* if (called && loading) return <p>Loading ...</p>
* if (!called) {
* return <button onClick={() => loadGreeting()}>Load greeting</button>
* }
* return <h1>Hello {data.greeting.message}!</h1>;
* }
* ```
* @since 3.0.0
*
* @param query - A GraphQL query document parsed into an AST by `gql`.
* @param options - Default options to control how the query is executed.
* @returns A tuple in the form of `[execute, result]`
*/
export function useLazyQuery(query, options) {

@@ -26,3 +61,3 @@ var _a;

// function remains referentially stable between renders.
optionsRef.current = merged;
optionsRef.current = options;
queryRef.current = document;

@@ -29,0 +64,0 @@ var internalState = useInternalState(useApolloClient(options && options.client), document);

@@ -9,7 +9,29 @@ import type { DocumentNode, OperationVariables, TypedDocumentNode } from "../../core/index.js";

export type UseLoadableQueryResult<TData = unknown, TVariables extends OperationVariables = OperationVariables> = [
LoadQueryFunction<TVariables>,
QueryReference<TData, TVariables> | null,
loadQuery: LoadQueryFunction<TVariables>,
queryRef: QueryReference<TData, TVariables> | null,
{
/**
* A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).
*
*
* @docGroup
*
* 3. Helper functions
*/
fetchMore: FetchMoreFunction<TData, TVariables>;
/**
* A function that enables you to re-execute the query, optionally passing in new `variables`.
*
* To guarantee that the refetch performs a network request, its `fetchPolicy` is set to `network-only` (unless the original query's `fetchPolicy` is `no-cache` or `cache-and-network`, which also guarantee a network request).
*
* See also [Refetching](https://www.apollographql.com/docs/react/data/queries/#refetching).
*
* @docGroup
*
* 3. Helper functions
*/
refetch: RefetchFunction<TData, TVariables>;
/**
* A function that resets the `queryRef` back to `null`.
*/
reset: ResetFunction;

@@ -29,4 +51,49 @@ }

}): UseLoadableQueryResult<DeepPartial<TData>, TVariables>;
/**
* A hook for imperatively loading a query, such as responding to a user
* interaction.
*
* > Refer to the [Suspense - Fetching in response to user interaction](https://www.apollographql.com/docs/react/data/suspense#fetching-in-response-to-user-interaction) section for a more in-depth overview of `useLoadableQuery`.
*
* @example
* ```jsx
* import { gql, useLoadableQuery } from "@apollo/client";
*
* const GET_GREETING = gql`
* query GetGreeting($language: String!) {
* greeting(language: $language) {
* message
* }
* }
* `;
*
* function App() {
* const [loadGreeting, queryRef] = useLoadableQuery(GET_GREETING);
*
* return (
* <>
* <button onClick={() => loadGreeting({ language: "english" })}>
* Load greeting
* </button>
* <Suspense fallback={<div>Loading...</div>}>
* {queryRef && <Hello queryRef={queryRef} />}
* </Suspense>
* </>
* );
* }
*
* function Hello({ queryRef }) {
* const { data } = useReadQuery(queryRef);
*
* return <div>{data.greeting.message}</div>;
* }
* ```
*
* @since 3.9.0
* @param query - A GraphQL query document parsed into an AST by `gql`.
* @param options - Options to control how the query is executed.
* @returns A tuple in the form of `[loadQuery, queryRef, handlers]`
*/
export declare function useLoadableQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: LoadableQueryHookOptions): UseLoadableQueryResult<TData, TVariables>;
export {};
//# sourceMappingURL=useLoadableQuery.d.ts.map

@@ -5,3 +5,50 @@ import type { DocumentNode } from "graphql";

import type { ApolloCache, DefaultContext, OperationVariables } from "../../core/index.js";
/**
*
*
* > Refer to the [Mutations](https://www.apollographql.com/docs/react/data/mutations/) section for a more in-depth overview of `useMutation`.
*
* @example
* ```jsx
* import { gql, useMutation } from '@apollo/client';
*
* const ADD_TODO = gql`
* mutation AddTodo($type: String!) {
* addTodo(type: $type) {
* id
* type
* }
* }
* `;
*
* function AddTodo() {
* let input;
* const [addTodo, { data }] = useMutation(ADD_TODO);
*
* return (
* <div>
* <form
* onSubmit={e => {
* e.preventDefault();
* addTodo({ variables: { type: input.value } });
* input.value = '';
* }}
* >
* <input
* ref={node => {
* input = node;
* }}
* />
* <button type="submit">Add Todo</button>
* </form>
* </div>
* );
* }
* ```
* @since 3.0.0
* @param mutation - A GraphQL mutation document parsed into an AST by `gql`.
* @param options - Options to control how the mutation is executed.
* @returns A tuple in the form of `[mutate, result]`
*/
export declare function useMutation<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>>(mutation: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: MutationHookOptions<NoInfer<TData>, NoInfer<TVariables>, TContext, TCache>): MutationTuple<TData, TVariables, TContext, TCache>;
//# sourceMappingURL=useMutation.d.ts.map

@@ -8,2 +8,49 @@ import { __assign } from "tslib";

import { useApolloClient } from "./useApolloClient.js";
/**
*
*
* > Refer to the [Mutations](https://www.apollographql.com/docs/react/data/mutations/) section for a more in-depth overview of `useMutation`.
*
* @example
* ```jsx
* import { gql, useMutation } from '@apollo/client';
*
* const ADD_TODO = gql`
* mutation AddTodo($type: String!) {
* addTodo(type: $type) {
* id
* type
* }
* }
* `;
*
* function AddTodo() {
* let input;
* const [addTodo, { data }] = useMutation(ADD_TODO);
*
* return (
* <div>
* <form
* onSubmit={e => {
* e.preventDefault();
* addTodo({ variables: { type: input.value } });
* input.value = '';
* }}
* >
* <input
* ref={node => {
* input = node;
* }}
* />
* <button type="submit">Add Todo</button>
* </form>
* </div>
* );
* }
* ```
* @since 3.0.0
* @param mutation - A GraphQL mutation document parsed into an AST by `gql`.
* @param options - Options to control how the mutation is executed.
* @returns A tuple in the form of `[mutate, result]`
*/
export function useMutation(mutation, options) {

@@ -10,0 +57,0 @@ var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);

@@ -5,2 +5,36 @@ import type { OperationVariables, WatchQueryFetchPolicy } from "../../core/index.js";

import { useApolloClient } from "./useApolloClient.js";
/**
* A hook for executing queries in an Apollo application.
*
* To run a query within a React component, call `useQuery` and pass it a GraphQL query document.
*
* When your component renders, `useQuery` returns an object from Apollo Client that contains `loading`, `error`, and `data` properties you can use to render your UI.
*
* > Refer to the [Queries](https://www.apollographql.com/docs/react/data/queries) section for a more in-depth overview of `useQuery`.
*
* @example
* ```jsx
* import { gql, useQuery } from '@apollo/client';
*
* const GET_GREETING = gql`
* query GetGreeting($language: String!) {
* greeting(language: $language) {
* message
* }
* }
* `;
*
* function Hello() {
* const { loading, error, data } = useQuery(GET_GREETING, {
* variables: { language: 'english' },
* });
* if (loading) return <p>Loading ...</p>;
* return <h1>Hello {data.greeting.message}!</h1>;
* }
* ```
* @since 3.0.0
* @param query - A GraphQL query document parsed into an AST by `gql`.
* @param options - Options to control how the query is executed.
* @returns Query result object
*/
export declare function useQuery<TData = any, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: QueryHookOptions<NoInfer<TData>, NoInfer<TVariables>>): QueryResult<TData, TVariables>;

@@ -7,0 +41,0 @@ export declare function useInternalState<TData, TVariables extends OperationVariables>(client: ApolloClient<any>, query: DocumentNode | TypedDocumentNode<TData, TVariables>): InternalState<TData, TVariables>;

@@ -13,5 +13,43 @@ import { __assign, __rest } from "tslib";

import { canUseWeakMap, compact, isNonEmptyArray, maybeDeepFreeze, } from "../../utilities/index.js";
import { wrapHook } from "./internal/index.js";
var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* A hook for executing queries in an Apollo application.
*
* To run a query within a React component, call `useQuery` and pass it a GraphQL query document.
*
* When your component renders, `useQuery` returns an object from Apollo Client that contains `loading`, `error`, and `data` properties you can use to render your UI.
*
* > Refer to the [Queries](https://www.apollographql.com/docs/react/data/queries) section for a more in-depth overview of `useQuery`.
*
* @example
* ```jsx
* import { gql, useQuery } from '@apollo/client';
*
* const GET_GREETING = gql`
* query GetGreeting($language: String!) {
* greeting(language: $language) {
* message
* }
* }
* `;
*
* function Hello() {
* const { loading, error, data } = useQuery(GET_GREETING, {
* variables: { language: 'english' },
* });
* if (loading) return <p>Loading ...</p>;
* return <h1>Hello {data.greeting.message}!</h1>;
* }
* ```
* @since 3.0.0
* @param query - A GraphQL query document parsed into an AST by `gql`.
* @param options - Options to control how the query is executed.
* @returns Query result object
*/
export function useQuery(query, options) {
if (options === void 0) { options = Object.create(null); }
return wrapHook("useQuery", _useQuery, useApolloClient(options && options.client))(query, options);
}
function _useQuery(query, options) {
return useInternalState(useApolloClient(options.client), query).useQuery(options);

@@ -18,0 +56,0 @@ }

@@ -7,8 +7,9 @@ import type { QueryReference } from "../internal/index.js";

* Update the variables of this observable query, and fetch the new results. This method should be preferred over `setVariables` in most use cases.
*
*
* @param variables - The new set of variables. If there are missing variables, the previous values of those variables will be used.
*/
refetch: RefetchFunction<TData, TVariables>;
/**
* A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).
*/
fetchMore: FetchMoreFunction<TData, TVariables>;

@@ -32,3 +33,3 @@ }

* ```
*
* @since 3.9.0
* @param queryRef - A `QueryReference` returned from `useBackgroundQuery`, `useLoadableQuery`, or `createQueryPreloader`.

@@ -35,0 +36,0 @@ */

@@ -19,3 +19,3 @@ import * as React from "rehackt";

* ```
*
* @since 3.9.0
* @param queryRef - A `QueryReference` returned from `useBackgroundQuery`, `useLoadableQuery`, or `createQueryPreloader`.

@@ -22,0 +22,0 @@ */

import type { ReactiveVar } from "../../core/index.js";
/**
* Reads the value of a [reactive variable](https://www.apollographql.com/docs/react/local-state/reactive-variables/) and re-renders the containing component whenever that variable's value changes. This enables a reactive variable to trigger changes _without_ relying on the `useQuery` hook.
*
* @example
* ```jsx
* import { makeVar, useReactiveVar } from "@apollo/client";
* export const cartItemsVar = makeVar([]);
*
* export function Cart() {
* const cartItems = useReactiveVar(cartItemsVar);
* // ...
* }
* ```
* @since 3.2.0
* @param rv - A reactive variable.
* @returns The current value of the reactive variable.
*/
export declare function useReactiveVar<T>(rv: ReactiveVar<T>): T;
//# sourceMappingURL=useReactiveVar.d.ts.map
import * as React from "rehackt";
import { useSyncExternalStore } from "./useSyncExternalStore.js";
/**
* Reads the value of a [reactive variable](https://www.apollographql.com/docs/react/local-state/reactive-variables/) and re-renders the containing component whenever that variable's value changes. This enables a reactive variable to trigger changes _without_ relying on the `useQuery` hook.
*
* @example
* ```jsx
* import { makeVar, useReactiveVar } from "@apollo/client";
* export const cartItemsVar = makeVar([]);
*
* export function Cart() {
* const cartItems = useReactiveVar(cartItemsVar);
* // ...
* }
* ```
* @since 3.2.0
* @param rv - A reactive variable.
* @returns The current value of the reactive variable.
*/
export function useReactiveVar(rv) {

@@ -4,0 +21,0 @@ return useSyncExternalStore(React.useCallback(function (update) {

import * as React from "rehackt";
import { getWrappedPromise, unwrapQueryRef, updateWrappedQueryRef, } from "../internal/index.js";
import { __use } from "./internal/index.js";
import { __use, wrapHook } from "./internal/index.js";
import { toApolloError } from "./useSuspenseQuery.js";
import { useSyncExternalStore } from "./useSyncExternalStore.js";
export function useReadQuery(queryRef) {
return wrapHook("useReadQuery", _useReadQuery, unwrapQueryRef(queryRef)["observable"])(queryRef);
}
function _useReadQuery(queryRef) {
var internalQueryRef = React.useMemo(function () { return unwrapQueryRef(queryRef); }, [queryRef]);

@@ -8,0 +11,0 @@ var getPromise = React.useCallback(function () { return getWrappedPromise(queryRef); }, [queryRef]);

@@ -5,3 +5,88 @@ import type { DocumentNode } from "graphql";

import type { OperationVariables } from "../../core/index.js";
/**
* > Refer to the [Subscriptions](https://www.apollographql.com/docs/react/data/subscriptions/) section for a more in-depth overview of `useSubscription`.
*
* @example
* ```jsx
* const COMMENTS_SUBSCRIPTION = gql`
* subscription OnCommentAdded($repoFullName: String!) {
* commentAdded(repoFullName: $repoFullName) {
* id
* content
* }
* }
* `;
*
* function DontReadTheComments({ repoFullName }) {
* const {
* data: { commentAdded },
* loading,
* } = useSubscription(COMMENTS_SUBSCRIPTION, { variables: { repoFullName } });
* return <h4>New comment: {!loading && commentAdded.content}</h4>;
* }
* ```
* @remarks
* #### Subscriptions and React 18 Automatic Batching
*
* With React 18's [automatic batching](https://react.dev/blog/2022/03/29/react-v18#new-feature-automatic-batching), multiple state updates may be grouped into a single re-render for better performance.
*
* If your subscription API sends multiple messages at the same time or in very fast succession (within fractions of a millisecond), it is likely that only the last message received in that narrow time frame will result in a re-render.
*
* Consider the following component:
*
* ```jsx
* export function Subscriptions() {
* const { data, error, loading } = useSubscription(query);
* const [accumulatedData, setAccumulatedData] = useState([]);
*
* useEffect(() => {
* setAccumulatedData((prev) => [...prev, data]);
* }, [data]);
*
* return (
* <>
* {loading && <p>Loading...</p>}
* {JSON.stringify(accumulatedData, undefined, 2)}
* </>
* );
* }
* ```
*
* If your subscription back-end emits two messages with the same timestamp, only the last message received by Apollo Client will be rendered. This is because React 18 will batch these two state updates into a single re-render.
*
* Since the component above is using `useEffect` to push `data` into a piece of local state on each `Subscriptions` re-render, the first message will never be added to the `accumulatedData` array since its render was skipped.
*
* Instead of using `useEffect` here, we can re-write this component to use the `onData` callback function accepted in `useSubscription`'s `options` object:
*
* ```jsx
* export function Subscriptions() {
* const [accumulatedData, setAccumulatedData] = useState([]);
* const { data, error, loading } = useSubscription(
* query,
* {
* onData({ data }) {
* setAccumulatedData((prev) => [...prev, data])
* }
* }
* );
*
* return (
* <>
* {loading && <p>Loading...</p>}
* {JSON.stringify(accumulatedData, undefined, 2)}
* </>
* );
* }
* ```
*
* > ⚠️ **Note:** The `useSubscription` option `onData` is available in Apollo Client >= 3.7. In previous versions, the equivalent option is named `onSubscriptionData`.
*
* Now, the first message will be added to the `accumulatedData` array since `onData` is called _before_ the component re-renders. React 18 automatic batching is still in effect and results in a single re-render, but with `onData` we can guarantee each message received after the component mounts is added to `accumulatedData`.
*
* @since 3.0.0
* @param subscription - A GraphQL subscription document parsed into an AST by `gql`.
* @param options - Options to control how the subscription is executed.
* @returns Query result object
*/
export declare function useSubscription<TData = any, TVariables extends OperationVariables = OperationVariables>(subscription: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: SubscriptionHookOptions<NoInfer<TData>, NoInfer<TVariables>>): SubscriptionResult<TData, TVariables>;
//# sourceMappingURL=useSubscription.d.ts.map

@@ -6,2 +6,87 @@ import { invariant } from "../../utilities/globals/index.js";

import { useApolloClient } from "./useApolloClient.js";
/**
* > Refer to the [Subscriptions](https://www.apollographql.com/docs/react/data/subscriptions/) section for a more in-depth overview of `useSubscription`.
*
* @example
* ```jsx
* const COMMENTS_SUBSCRIPTION = gql`
* subscription OnCommentAdded($repoFullName: String!) {
* commentAdded(repoFullName: $repoFullName) {
* id
* content
* }
* }
* `;
*
* function DontReadTheComments({ repoFullName }) {
* const {
* data: { commentAdded },
* loading,
* } = useSubscription(COMMENTS_SUBSCRIPTION, { variables: { repoFullName } });
* return <h4>New comment: {!loading && commentAdded.content}</h4>;
* }
* ```
* @remarks
* #### Subscriptions and React 18 Automatic Batching
*
* With React 18's [automatic batching](https://react.dev/blog/2022/03/29/react-v18#new-feature-automatic-batching), multiple state updates may be grouped into a single re-render for better performance.
*
* If your subscription API sends multiple messages at the same time or in very fast succession (within fractions of a millisecond), it is likely that only the last message received in that narrow time frame will result in a re-render.
*
* Consider the following component:
*
* ```jsx
* export function Subscriptions() {
* const { data, error, loading } = useSubscription(query);
* const [accumulatedData, setAccumulatedData] = useState([]);
*
* useEffect(() => {
* setAccumulatedData((prev) => [...prev, data]);
* }, [data]);
*
* return (
* <>
* {loading && <p>Loading...</p>}
* {JSON.stringify(accumulatedData, undefined, 2)}
* </>
* );
* }
* ```
*
* If your subscription back-end emits two messages with the same timestamp, only the last message received by Apollo Client will be rendered. This is because React 18 will batch these two state updates into a single re-render.
*
* Since the component above is using `useEffect` to push `data` into a piece of local state on each `Subscriptions` re-render, the first message will never be added to the `accumulatedData` array since its render was skipped.
*
* Instead of using `useEffect` here, we can re-write this component to use the `onData` callback function accepted in `useSubscription`'s `options` object:
*
* ```jsx
* export function Subscriptions() {
* const [accumulatedData, setAccumulatedData] = useState([]);
* const { data, error, loading } = useSubscription(
* query,
* {
* onData({ data }) {
* setAccumulatedData((prev) => [...prev, data])
* }
* }
* );
*
* return (
* <>
* {loading && <p>Loading...</p>}
* {JSON.stringify(accumulatedData, undefined, 2)}
* </>
* );
* }
* ```
*
* > ⚠️ **Note:** The `useSubscription` option `onData` is available in Apollo Client >= 3.7. In previous versions, the equivalent option is named `onSubscriptionData`.
*
* Now, the first message will be added to the `accumulatedData` array since `onData` is called _before_ the component re-renders. React 18 automatic batching is still in effect and results in a single re-render, but with `onData` we can guarantee each message received after the component mounts is added to `accumulatedData`.
*
* @since 3.0.0
* @param subscription - A GraphQL subscription document parsed into an AST by `gql`.
* @param options - Options to control how the subscription is executed.
* @returns Query result object
*/
export function useSubscription(subscription, options) {

@@ -8,0 +93,0 @@ var hasIssuedDeprecationWarningRef = React.useRef(false);

@@ -8,3 +8,3 @@ import { __assign, __spreadArray } from "tslib";

import { DocumentType, verifyDocumentType } from "../parser/index.js";
import { __use, useDeepMemo } from "./internal/index.js";
import { __use, useDeepMemo, wrapHook } from "./internal/index.js";
import { getSuspenseCache } from "../internal/index.js";

@@ -15,2 +15,5 @@ import { canonicalStringify } from "../../cache/index.js";

if (options === void 0) { options = Object.create(null); }
return wrapHook("useSuspenseQuery", _useSuspenseQuery, useApolloClient(typeof options === "object" ? options.client : undefined))(query, options);
}
function _useSuspenseQuery(query, options) {
var client = useApolloClient(options.client);

@@ -17,0 +20,0 @@ var suspenseCache = getSuspenseCache(client);

@@ -15,4 +15,43 @@ import type { ApolloQueryResult, ObservableQuery, OperationVariables, WatchQueryOptions } from "../../../core/index.js";

export interface QueryReference<TData = unknown, TVariables = unknown> {
/** @internal */
readonly [QUERY_REFERENCE_SYMBOL]: InternalQueryReference<TData>;
/** @internal */
[PROMISE_SYMBOL]: QueryRefPromise<TData>;
/**
* A function that returns a promise that resolves when the query has finished
* loading. The promise resolves with the `QueryReference` itself.
*
* @remarks
* This method is useful for preloading queries in data loading routers, such
* as [React Router](https://reactrouter.com/en/main) or [TanStack Router](https://tanstack.com/router),
* to prevent routes from transitioning until the query has finished loading.
* `data` is not exposed on the promise to discourage using the data in
* `loader` functions and exposing it to your route components. Instead, we
* prefer you rely on `useReadQuery` to access the data to ensure your
* component can rerender with cache updates. If you need to access raw query
* data, use `client.query()` directly.
*
* @example
* Here's an example using React Router's `loader` function:
* ```ts
* import { createQueryPreloader } from "@apollo/client";
*
* const preloadQuery = createQueryPreloader(client);
*
* export async function loader() {
* const queryRef = preloadQuery(GET_DOGS_QUERY);
*
* return queryRef.toPromise();
* }
*
* export function RouteComponent() {
* const queryRef = useLoaderData();
* const { data } = useReadQuery(queryRef);
*
* // ...
* }
* ```
*
* @alpha
*/
toPromise(): Promise<QueryReference<TData, TVariables>>;

@@ -19,0 +58,0 @@ }

@@ -195,3 +195,4 @@ import { __assign } from "tslib";

// subscribing, which delivers a result from the cache.
if (result.data === this.result.data) {
if (result.data === this.result.data &&
result.networkStatus === this.result.networkStatus) {
return;

@@ -240,7 +241,19 @@ }

.then(function (result) {
var _a;
if (_this.promise.status === "pending") {
_this.result = result;
(_a = _this.resolve) === null || _a === void 0 ? void 0 : _a.call(_this, result);
}
// In the case of `fetchMore`, this promise is resolved before a cache
// result is emitted due to the fact that `fetchMore` sets a `no-cache`
// fetch policy and runs `cache.batch` in its `.then` handler. Because
// the timing is different, we accidentally run this update twice
// causing an additional re-render with the `fetchMore` result by
// itself. By wrapping in `setTimeout`, this should provide a short
// delay to allow the `QueryInfo.notify` handler to run before this
// promise is checked.
// See https://github.com/apollographql/apollo-client/issues/11315 for
// more information
setTimeout(function () {
var _a;
if (_this.promise.status === "pending") {
_this.result = result;
(_a = _this.resolve) === null || _a === void 0 ? void 0 : _a.call(_this, result);
}
});
})

@@ -247,0 +260,0 @@ .catch(function () { });

@@ -6,2 +6,3 @@ export { getSuspenseCache } from "./cache/getSuspenseCache.js";

export type { SuspenseCacheOptions } from "./cache/SuspenseCache.js";
export type { HookWrappers } from "../hooks/internal/wrapHook.js";
//# sourceMappingURL=index.d.ts.map

@@ -173,3 +173,4 @@ 'use strict';

default: {
if (result.data === this.result.data) {
if (result.data === this.result.data &&
result.networkStatus === this.result.networkStatus) {
return;

@@ -211,7 +212,9 @@ }

.then(function (result) {
var _a;
if (_this.promise.status === "pending") {
_this.result = result;
(_a = _this.resolve) === null || _a === void 0 ? void 0 : _a.call(_this, result);
}
setTimeout(function () {
var _a;
if (_this.promise.status === "pending") {
_this.result = result;
(_a = _this.resolve) === null || _a === void 0 ? void 0 : _a.call(_this, result);
}
});
})

@@ -218,0 +221,0 @@ .catch(function () { });

@@ -9,17 +9,32 @@ import type { ApolloClient, DefaultContext, DocumentNode, ErrorPolicy, OperationVariables, RefetchWritePolicy, TypedDocumentNode, WatchQueryFetchPolicy } from "../../core/index.js";

/**
* A map going from variable name to variable value, where the variables are used within the GraphQL query.
* An object containing all of the GraphQL variables your query requires to execute.
*
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
*
* @docGroup
*
* 1. Operation options
*/
variables?: Record<string, never>;
} : {} extends OnlyRequiredProperties<TVariables> ? {
/**
* A map going from variable name to variable value, where the variables are used within the GraphQL query.
* An object containing all of the GraphQL variables your query requires to execute.
*
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
*
* @docGroup
*
* 1. Operation options
*/
variables?: TVariables;
} : {
/**
* A map going from variable name to variable value, where the variables are used within the GraphQL query.
* An object containing all of the GraphQL variables your query requires to execute.
*
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
*
* @docGroup
*
* 1. Operation options
*/
variables: TVariables;

@@ -30,34 +45,58 @@ };

/**
* Whether to canonize cache results before returning them. Canonization takes some extra time, but it speeds up future deep equality comparisons. Defaults to false.
*
* @deprecated
*
*
* Using `canonizeResults` can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.
*
* Whether to canonize cache results before returning them. Canonization takes some extra time, but it speeds up future deep equality comparisons. Defaults to false.
*/
canonizeResults?: boolean;
/**
* Context to be passed to link execution chain
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
*
* @docGroup
*
* 2. Networking options
*/
context?: DefaultContext;
/**
* Specifies the {@link ErrorPolicy} to be used for this query
* Specifies how the query handles a response that returns both GraphQL errors and partial results.
*
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
*
* The default value is `none`, meaning that the query result includes error details but not partial results.
*
* @docGroup
*
* 1. Operation options
*/
errorPolicy?: ErrorPolicy;
/**
* Specifies the {@link FetchPolicy} to be used for this query
* Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).
*
* For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
*
* The default value is `cache-first`.
*
* @docGroup
*
* 3. Caching options
*/
fetchPolicy?: PreloadQueryFetchPolicy;
/**
* Allow returning incomplete data from the cache when a larger query cannot be fully satisfied by the cache, instead of returning nothing.
* If `true`, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.
*
* The default value is `false`.
*
* @docGroup
*
* 3. Caching options
*/
returnPartialData?: boolean;
/**
* Specifies whether a {@link NetworkStatus.refetch} operation should merge incoming field data with existing data, or overwrite the existing data. Overwriting is probably preferable, but merging is currently the default behavior, for backwards compatibility with Apollo Client 3.x.
* Specifies whether a `NetworkStatus.refetch` operation should merge incoming field data with existing data, or overwrite the existing data. Overwriting is probably preferable, but merging is currently the default behavior, for backwards compatibility with Apollo Client 3.x.
*
* @docGroup
*
* 3. Caching options
*/
refetchWritePolicy?: RefetchWritePolicy;

@@ -101,3 +140,3 @@ } & VariablesOption<TVariables>;

* A function that will begin loading a query when called. It's result can be read by {@link useReadQuery} which will suspend until the query is loaded. This is useful when you want to start loading a query as early as possible outside of a React component.
*
*
* @example

@@ -107,3 +146,3 @@ * ```js

* const queryRef = preloadQuery(query, { variables, ...otherOptions });
*
*
* function App() {

@@ -116,16 +155,14 @@ * return (

* }
*
*
* function MyQuery() {
* const { data } = useReadQuery(queryRef);
*
*
* // do something with `data`
* }
* ```
*
*/
<TData, TVariables extends OperationVariables, TOptions extends Omit<PreloadQueryOptions, "variables">>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, ...[options]: PreloadQueryOptionsArg<NoInfer<TVariables>, TOptions>): QueryReference<TOptions["errorPolicy"] extends "ignore" | "all" ? TOptions["returnPartialData"] extends true ? DeepPartial<TData> | undefined : TData | undefined : TOptions["returnPartialData"] extends true ? DeepPartial<TData> : TData, TVariables>;
/**
* A function that will begin loading a query when called. It's result can be read by {@link useReadQuery} which will suspend until the query is loaded. This is useful when you want to start loading a query as early as possible outside of a React component.
*
*
* @example

@@ -135,3 +172,3 @@ * ```js

* const queryRef = preloadQuery(query, { variables, ...otherOptions });
*
*
* function App() {

@@ -144,12 +181,10 @@ * return (

* }
*
*
* function MyQuery() {
* const { data } = useReadQuery(queryRef);
*
*
* // do something with `data`
* }
* ```
*
*/
<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: PreloadQueryOptions<NoInfer<TVariables>> & {

@@ -161,3 +196,3 @@ returnPartialData: true;

* A function that will begin loading a query when called. It's result can be read by {@link useReadQuery} which will suspend until the query is loaded. This is useful when you want to start loading a query as early as possible outside of a React component.
*
*
* @example

@@ -167,3 +202,3 @@ * ```js

* const queryRef = preloadQuery(query, { variables, ...otherOptions });
*
*
* function App() {

@@ -176,12 +211,10 @@ * return (

* }
*
*
* function MyQuery() {
* const { data } = useReadQuery(queryRef);
*
*
* // do something with `data`
* }
* ```
*
*/
<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: PreloadQueryOptions<NoInfer<TVariables>> & {

@@ -192,3 +225,3 @@ errorPolicy: "ignore" | "all";

* A function that will begin loading a query when called. It's result can be read by {@link useReadQuery} which will suspend until the query is loaded. This is useful when you want to start loading a query as early as possible outside of a React component.
*
*
* @example

@@ -198,3 +231,3 @@ * ```js

* const queryRef = preloadQuery(query, { variables, ...otherOptions });
*
*
* function App() {

@@ -207,12 +240,10 @@ * return (

* }
*
*
* function MyQuery() {
* const { data } = useReadQuery(queryRef);
*
*
* // do something with `data`
* }
* ```
*
*/
<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: PreloadQueryOptions<NoInfer<TVariables>> & {

@@ -223,3 +254,3 @@ returnPartialData: true;

* A function that will begin loading a query when called. It's result can be read by {@link useReadQuery} which will suspend until the query is loaded. This is useful when you want to start loading a query as early as possible outside of a React component.
*
*
* @example

@@ -229,3 +260,3 @@ * ```js

* const queryRef = preloadQuery(query, { variables, ...otherOptions });
*
*
* function App() {

@@ -238,12 +269,10 @@ * return (

* }
*
*
* function MyQuery() {
* const { data } = useReadQuery(queryRef);
*
*
* // do something with `data`
* }
* ```
*
*/
<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, ...[options]: PreloadQueryOptionsArg<NoInfer<TVariables>>): QueryReference<TData, TVariables>;

@@ -257,3 +286,5 @@ }

*
* @param client - The ApolloClient instance that will be used to load queries
* > Refer to the [Suspense - Initiating queries outside React](https://www.apollographql.com/docs/react/data/suspense#initiating-queries-outside-react) section for a more in-depth overview.
*
* @param client - The `ApolloClient` instance that will be used to load queries
* from the returned `preloadQuery` function.

@@ -266,3 +297,4 @@ * @returns The `preloadQuery` function.

* ```
* @experimental
* @since 3.9.0
* @alpha
*/

@@ -269,0 +301,0 @@ export declare function createQueryPreloader(client: ApolloClient<any>): PreloadQueryFunction;

@@ -9,3 +9,5 @@ import { __assign } from "tslib";

*
* @param client - The ApolloClient instance that will be used to load queries
* > Refer to the [Suspense - Initiating queries outside React](https://www.apollographql.com/docs/react/data/suspense#initiating-queries-outside-react) section for a more in-depth overview.
*
* @param client - The `ApolloClient` instance that will be used to load queries
* from the returned `preloadQuery` function.

@@ -18,3 +20,4 @@ * @returns The `preloadQuery` function.

* ```
* @experimental
* @since 3.9.0
* @alpha
*/

@@ -21,0 +24,0 @@ export function createQueryPreloader(client) {

@@ -7,3 +7,4 @@ import type * as ReactTypes from "react";

import type { ApolloError } from "../../errors/index.js";
import type { ApolloCache, ApolloClient, DefaultContext, FetchPolicy, MutationOptions, NetworkStatus, ObservableQuery, OperationVariables, InternalRefetchQueriesInclude, WatchQueryOptions, WatchQueryFetchPolicy, ErrorPolicy, RefetchWritePolicy } from "../../core/index.js";
import type { ApolloCache, ApolloClient, DefaultContext, FetchPolicy, NetworkStatus, ObservableQuery, OperationVariables, InternalRefetchQueriesInclude, WatchQueryOptions, WatchQueryFetchPolicy, SubscribeToMoreOptions, ApolloQueryResult, FetchMoreQueryOptions, ErrorPolicy, RefetchWritePolicy } from "../../core/index.js";
import type { MutationSharedOptions, SharedWatchQueryOptions } from "../../core/watchQueryOptions.js";
export type { QueryReference } from "../internal/index.js";

@@ -14,22 +15,212 @@ export type { DefaultContext as Context } from "../../core/index.js";

};
export interface BaseQueryOptions<TVariables extends OperationVariables = OperationVariables> extends Omit<WatchQueryOptions<TVariables>, "query"> {
export interface BaseQueryOptions<TVariables extends OperationVariables = OperationVariables, TData = any> extends SharedWatchQueryOptions<TVariables, TData> {
/**
* Pass `false` to skip executing the query during [server-side rendering](https://www.apollographql.com/docs/react/performance/server-side-rendering/).
*
* @docGroup
*
* 2. Networking options
*/
ssr?: boolean;
/**
* The instance of {@link ApolloClient} to use to execute the query.
*
* By default, the instance that's passed down via context is used, but you can provide a different instance here.
*
* @docGroup
*
* 1. Operation options
*/
client?: ApolloClient<any>;
/**
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
*
* @docGroup
*
* 2. Networking options
*/
context?: DefaultContext;
}
export interface QueryFunctionOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends BaseQueryOptions<TVariables> {
export interface QueryFunctionOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends BaseQueryOptions<TVariables, TData> {
/**
* If true, the query is not executed.
*
* The default value is `false`.
*
* @docGroup
*
* 1. Operation options
*/
skip?: boolean;
/**
* A callback function that's called when your query successfully completes with zero errors (or if `errorPolicy` is `ignore` and partial data is returned).
*
* This function is passed the query's result `data`.
*
* @docGroup
*
* 1. Operation options
*/
onCompleted?: (data: TData) => void;
/**
* A callback function that's called when the query encounters one or more errors (unless `errorPolicy` is `ignore`).
*
* This function is passed an `ApolloError` object that contains either a `networkError` object or a `graphQLErrors` array, depending on the error(s) that occurred.
*
* @docGroup
*
* 1. Operation options
*/
onError?: (error: ApolloError) => void;
/** @internal */
defaultOptions?: Partial<WatchQueryOptions<TVariables, TData>>;
}
export type ObservableQueryFields<TData, TVariables extends OperationVariables> = Pick<ObservableQuery<TData, TVariables>, "startPolling" | "stopPolling" | "subscribeToMore" | "updateQuery" | "refetch" | "reobserve" | "variables" | "fetchMore">;
export interface ObservableQueryFields<TData, TVariables extends OperationVariables> {
/**
* A function that instructs the query to begin re-executing at a specified interval (in milliseconds).
*
*
* @docGroup
*
* 3. Helper functions
*/
startPolling: (pollInterval: number) => void;
/**
* A function that instructs the query to stop polling after a previous call to `startPolling`.
*
*
* @docGroup
*
* 3. Helper functions
*/
stopPolling: () => void;
/**
* A function that enables you to execute a [subscription](https://www.apollographql.com/docs/react/data/subscriptions/), usually to subscribe to specific fields that were included in the query.
*
* This function returns _another_ function that you can call to terminate the subscription.
*
*
* @docGroup
*
* 3. Helper functions
*/
subscribeToMore: <TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>) => () => void;
/**
* A function that enables you to update the query's cached result without executing a followup GraphQL operation.
*
* See [using updateQuery and updateFragment](https://www.apollographql.com/docs/react/caching/cache-interaction/#using-updatequery-and-updatefragment) for additional information.
*
*
* @docGroup
*
* 3. Helper functions
*/
updateQuery: <TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData) => void;
/**
* A function that enables you to re-execute the query, optionally passing in new `variables`.
*
* To guarantee that the refetch performs a network request, its `fetchPolicy` is set to `network-only` (unless the original query's `fetchPolicy` is `no-cache` or `cache-and-network`, which also guarantee a network request).
*
* See also [Refetching](https://www.apollographql.com/docs/react/data/queries/#refetching).
*
* @docGroup
*
* 3. Helper functions
*/
refetch: (variables?: Partial<TVariables>) => Promise<ApolloQueryResult<TData>>;
/** @internal */
reobserve: (newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus) => Promise<ApolloQueryResult<TData>>;
/**
* An object containing the variables that were provided for the query.
*
* @docGroup
*
* 1. Operation data
*/
variables: TVariables | undefined;
/**
* A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).
*
*
* @docGroup
*
* 3. Helper functions
*/
fetchMore: <TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
updateQuery?: (previousQueryResult: TData, options: {
fetchMoreResult: TFetchData;
variables: TFetchVars;
}) => TData;
}) => Promise<ApolloQueryResult<TFetchData>>;
}
export interface QueryResult<TData = any, TVariables extends OperationVariables = OperationVariables> extends ObservableQueryFields<TData, TVariables> {
/**
* The instance of Apollo Client that executed the query. Can be useful for manually executing followup queries or writing data to the cache.
*
* @docGroup
*
* 2. Network info
*/
client: ApolloClient<any>;
/**
* A reference to the internal `ObservableQuery` used by the hook.
*/
observable: ObservableQuery<TData, TVariables>;
/**
* An object containing the result of your GraphQL query after it completes.
*
* This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).
*
* @docGroup
*
* 1. Operation data
*/
data: TData | undefined;
/**
* An object containing the result from the most recent _previous_ execution of this query.
*
* This value is `undefined` if this is the query's first execution.
*
* @docGroup
*
* 1. Operation data
*/
previousData?: TData;
/**
* If the query produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.
*
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
*
* @docGroup
*
* 1. Operation data
*/
error?: ApolloError;
/**
* If `true`, the query is still in flight and results have not yet been returned.
*
* @docGroup
*
* 2. Network info
*/
loading: boolean;
/**
* A number indicating the current network state of the query's associated request. [See possible values.](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/core/networkStatus.ts#L4)
*
* Used in conjunction with the [`notifyOnNetworkStatusChange`](#notifyonnetworkstatuschange) option.
*
* @docGroup
*
* 2. Network info
*/
networkStatus: NetworkStatus;
/**
* If `true`, the associated lazy query has been executed.
*
* This field is only present on the result object returned by [`useLazyQuery`](/react/data/queries/#executing-queries-manually).
*
* @docGroup
*
* 2. Network info
*/
called: boolean;

@@ -39,2 +230,9 @@ }

children?: (result: QueryResult<TData, TVariables>) => ReactTypes.ReactNode;
/**
* A GraphQL query string parsed into an AST with the gql template literal.
*
* @docGroup
*
* 1. Operation options
*/
query: DocumentNode | TypedDocumentNode<TData, TVariables>;

@@ -44,3 +242,25 @@ }

}
export interface LazyQueryHookOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends Omit<QueryHookOptions<TData, TVariables>, "skip"> {
export interface LazyQueryHookOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends BaseQueryOptions<TVariables, TData> {
/**
* A callback function that's called when your query successfully completes with zero errors (or if `errorPolicy` is `ignore` and partial data is returned).
*
* This function is passed the query's result `data`.
*
* @docGroup
*
* 1. Operation options
*/
onCompleted?: (data: TData) => void;
/**
* A callback function that's called when the query encounters one or more errors (unless `errorPolicy` is `ignore`).
*
* This function is passed an `ApolloError` object that contains either a `networkError` object or a `graphQLErrors` array, depending on the error(s) that occurred.
*
* @docGroup
*
* 1. Operation options
*/
onError?: (error: ApolloError) => void;
/** @internal */
defaultOptions?: Partial<WatchQueryOptions<TVariables, TData>>;
}

@@ -51,15 +271,111 @@ export interface LazyQueryHookExecOptions<TData = any, TVariables extends OperationVariables = OperationVariables> extends LazyQueryHookOptions<TData, TVariables> {

export type SuspenseQueryHookFetchPolicy = Extract<WatchQueryFetchPolicy, "cache-first" | "network-only" | "no-cache" | "cache-and-network">;
export interface SuspenseQueryHookOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables> extends Pick<QueryHookOptions<TData, TVariables>, "client" | "variables" | "errorPolicy" | "context" | "canonizeResults" | "returnPartialData" | "refetchWritePolicy"> {
export interface SuspenseQueryHookOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables> {
/**
* The instance of {@link ApolloClient} to use to execute the query.
*
* By default, the instance that's passed down via context is used, but you can provide a different instance here.
*
* @docGroup
*
* 1. Operation options
*/
client?: ApolloClient<any>;
/**
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
*
* @docGroup
*
* 2. Networking options
*/
context?: DefaultContext;
/**
* An object containing all of the GraphQL variables your query requires to execute.
*
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
*
* @docGroup
*
* 1. Operation options
*/
variables?: TVariables;
/**
* Specifies how the query handles a response that returns both GraphQL errors and partial results.
*
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
*
* The default value is `none`, meaning that the query result includes error details but not partial results.
*
* @docGroup
*
* 1. Operation options
*/
errorPolicy?: ErrorPolicy;
/**
* Whether to canonize cache results before returning them. Canonization takes some extra time, but it speeds up future deep equality comparisons. Defaults to false.
*
* @deprecated
*
* Using `canonizeResults` can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.
*/
canonizeResults?: boolean;
/**
* If `true`, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.
*
* The default value is `false`.
*
* @docGroup
*
* 3. Caching options
*/
returnPartialData?: boolean;
/**
* Watched queries must opt into overwriting existing data on refetch, by passing refetchWritePolicy: "overwrite" in their WatchQueryOptions.
*
* The default value is "overwrite".
*
* @docGroup
*
* 3. Caching options
*/
refetchWritePolicy?: RefetchWritePolicy;
/**
* Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).
*
* For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
*
* The default value is `cache-first`.
*
* @docGroup
*
* 3. Caching options
*/
fetchPolicy?: SuspenseQueryHookFetchPolicy;
/**
* A unique identifier for the query. Each item in the array must be a stable identifier to prevent infinite fetches.
*
* This is useful when using the same query and variables combination in more than one component, otherwise the components may clobber each other. This can also be used to force the query to re-evaluate fresh.
*
* @docGroup
*
* 1. Operation options
*/
queryKey?: string | number | any[];
/**
* If `true`, the query is not executed. The default value is `false`.
*
* @deprecated We recommend using `skipToken` in place of the `skip` option as
* it is more type-safe.
*
*
* @deprecated
*
* We recommend using `skipToken` in place of the `skip` option as it is more type-safe.
*
* This option is deprecated and only supported to ease the migration from useQuery. It will be removed in a future release.
*
* @docGroup
*
* 1. Operation options
*
*
* @example Recommended usage of `skipToken`:
* ```ts
* import { skipToken, useSuspenseQuery } from '@apollo/client';
*
*
* const { data } = useSuspenseQuery(query, id ? { variables: { id } } : skipToken);

@@ -76,10 +392,18 @@ * ```

* If `true`, the query is not executed. The default value is `false`.
*
* @deprecated We recommend using `skipToken` in place of the `skip` option as
* it is more type-safe.
*
*
* @deprecated
*
* We recommend using `skipToken` in place of the `skip` option as it is more type-safe.
*
* This option is deprecated and only supported to ease the migration from useQuery. It will be removed in a future release.
*
* @docGroup
*
* 1. Operation options
*
*
* @example Recommended usage of `skipToken`:
* ```ts
* import { skipToken, useBackgroundQuery } from '@apollo/client';
*
*
* const [queryRef] = useBackgroundQuery(query, id ? { variables: { id } } : skipToken);

@@ -93,11 +417,7 @@ * ```

/**
* Whether to canonize cache results before returning them. Canonization takes some extra time, but it speeds up future deep equality comparisons. Defaults to false.
*
* @deprecated
* Using `canonizeResults` can result in memory leaks so we generally do not
* recommend using this option anymore.
* A future version of Apollo Client will contain a similar feature without
* the risk of memory leaks.
*
* Whether to canonize cache results before returning them. Canonization
* takes some extra time, but it speeds up future deep equality comparisons.
* Defaults to false.
*
* Using `canonizeResults` can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.
*/

@@ -107,45 +427,68 @@ canonizeResults?: boolean;

* The instance of {@link ApolloClient} to use to execute the query.
*
* By default, the instance that's passed down via context is used, but you
* can provide a different instance here.
*
* By default, the instance that's passed down via context is used, but you can provide a different instance here.
*
* @docGroup
*
* 1. Operation options
*/
client?: ApolloClient<any>;
/**
* Context to be passed to link execution chain
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
*
* @docGroup
*
* 2. Networking options
*/
context?: DefaultContext;
/**
* Specifies the {@link ErrorPolicy} to be used for this query
* Specifies how the query handles a response that returns both GraphQL errors and partial results.
*
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
*
* The default value is `none`, meaning that the query result includes error details but not partial results.
*
* @docGroup
*
* 1. Operation options
*/
errorPolicy?: ErrorPolicy;
/**
*
* Specifies how the query interacts with the Apollo Client cache during
* execution (for example, whether it checks the cache for results before
* sending a request to the server).
*
* For details, see {@link https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy | Setting a fetch policy}.
*
* Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).
*
* For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
*
* The default value is `cache-first`.
*
* @docGroup
*
* 3. Caching options
*/
fetchPolicy?: LoadableQueryHookFetchPolicy;
/**
* A unique identifier for the query. Each item in the array must be a stable
* identifier to prevent infinite fetches.
*
* This is useful when using the same query and variables combination in more
* than one component, otherwise the components may clobber each other. This
* can also be used to force the query to re-evaluate fresh.
* A unique identifier for the query. Each item in the array must be a stable identifier to prevent infinite fetches.
*
* This is useful when using the same query and variables combination in more than one component, otherwise the components may clobber each other. This can also be used to force the query to re-evaluate fresh.
*
* @docGroup
*
* 1. Operation options
*/
queryKey?: string | number | any[];
/**
* Specifies whether a {@link NetworkStatus.refetch} operation should merge
* incoming field data with existing data, or overwrite the existing data.
* Overwriting is probably preferable, but merging is currently the default
* behavior, for backwards compatibility with Apollo Client 3.x.
* Specifies whether a `NetworkStatus.refetch` operation should merge incoming field data with existing data, or overwrite the existing data. Overwriting is probably preferable, but merging is currently the default behavior, for backwards compatibility with Apollo Client 3.x.
*
* @docGroup
*
* 3. Caching options
*/
refetchWritePolicy?: RefetchWritePolicy;
/**
* Allow returning incomplete data from the cache when a larger query cannot
* be fully satisfied by the cache, instead of returning nothing.
* If `true`, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.
*
* The default value is `false`.
*
* @docGroup
*
* 3. Caching options
*/

@@ -155,35 +498,128 @@ returnPartialData?: boolean;

/**
* @deprecated TODO Delete this unused interface.
* @deprecated This type will be removed in the next major version of Apollo Client
*/
export interface QueryLazyOptions<TVariables> {
/**
* An object containing all of the GraphQL variables your query requires to execute.
*
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
*
* @docGroup
*
* 1. Operation options
*/
variables?: TVariables;
/**
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
*
* @docGroup
*
* 2. Networking options
*/
context?: DefaultContext;
}
/**
* @deprecated TODO Delete this unused type alias.
* @deprecated This type will be removed in the next major version of Apollo Client
*/
export type LazyQueryResult<TData, TVariables extends OperationVariables> = QueryResult<TData, TVariables>;
/**
* @deprecated TODO Delete this unused type alias.
* @deprecated This type will be removed in the next major version of Apollo Client
*/
export type QueryTuple<TData, TVariables extends OperationVariables> = LazyQueryResultTuple<TData, TVariables>;
export type LazyQueryExecFunction<TData, TVariables extends OperationVariables> = (options?: Partial<LazyQueryHookExecOptions<TData, TVariables>>) => Promise<QueryResult<TData, TVariables>>;
export type LazyQueryResultTuple<TData, TVariables extends OperationVariables> = [LazyQueryExecFunction<TData, TVariables>, QueryResult<TData, TVariables>];
export type LazyQueryResultTuple<TData, TVariables extends OperationVariables> = [
execute: LazyQueryExecFunction<TData, TVariables>,
result: QueryResult<TData, TVariables>
];
export type RefetchQueriesFunction = (...args: any[]) => InternalRefetchQueriesInclude;
export interface BaseMutationOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends Omit<MutationOptions<TData, TVariables, TContext, TCache>, "mutation"> {
export interface BaseMutationOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationSharedOptions<TData, TVariables, TContext, TCache> {
/**
* The instance of `ApolloClient` to use to execute the mutation.
*
* By default, the instance that's passed down via context is used, but you can provide a different instance here.
*
* @docGroup
*
* 2. Networking options
*/
client?: ApolloClient<object>;
/**
* If `true`, the in-progress mutation's associated component re-renders whenever the network status changes or a network error occurs.
*
* The default value is `false`.
*
* @docGroup
*
* 2. Networking options
*/
notifyOnNetworkStatusChange?: boolean;
/**
* A callback function that's called when your mutation successfully completes with zero errors (or if `errorPolicy` is `ignore` and partial data is returned).
*
* This function is passed the mutation's result `data` and any options passed to the mutation.
*
* @docGroup
*
* 1. Operation options
*/
onCompleted?: (data: TData, clientOptions?: BaseMutationOptions) => void;
/**
* A callback function that's called when the mutation encounters one or more errors (unless `errorPolicy` is `ignore`).
*
* This function is passed an [`ApolloError`](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/errors/index.ts#L36-L39) object that contains either a `networkError` object or a `graphQLErrors` array, depending on the error(s) that occurred, as well as any options passed the mutation.
*
* @docGroup
*
* 1. Operation options
*/
onError?: (error: ApolloError, clientOptions?: BaseMutationOptions) => void;
/**
* If `true`, the mutation's `data` property is not updated with the mutation's result.
*
* The default value is `false`.
*
* @docGroup
*
* 1. Operation options
*/
ignoreResults?: boolean;
}
export interface MutationFunctionOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {
/**
* A GraphQL document, often created with `gql` from the `graphql-tag` package, that contains a single mutation inside of it.
*
* @docGroup
*
* 1. Operation options
*/
mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;
}
export interface MutationResult<TData = any> {
/**
* The data returned from your mutation. Can be `undefined` if `ignoreResults` is `true`.
*/
data?: TData | null;
/**
* If the mutation produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.
*
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
*/
error?: ApolloError;
/**
* If `true`, the mutation is currently in flight.
*/
loading: boolean;
/**
* If `true`, the mutation's mutate function has been called.
*/
called: boolean;
/**
* The instance of Apollo Client that executed the mutation.
*
* Can be useful for manually executing followup operations or writing data to the cache.
*/
client: ApolloClient<object>;
/**
* A function that you can call to reset the mutation's result to its initial, uncalled state.
*/
reset(): void;

@@ -198,4 +634,4 @@ }

export type MutationTuple<TData, TVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> = [
(options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>) => Promise<FetchResult<TData>>,
MutationResult<TData>
mutate: (options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>) => Promise<FetchResult<TData>>,
result: MutationResult<TData>
];

@@ -211,17 +647,64 @@ export interface OnDataOptions<TData = any> {

export interface BaseSubscriptionOptions<TData = any, TVariables extends OperationVariables = OperationVariables> {
/**
* An object containing all of the variables your subscription needs to execute
*/
variables?: TVariables;
/**
* How you want your component to interact with the Apollo cache. For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
*/
fetchPolicy?: FetchPolicy;
/**
* Determines if your subscription should be unsubscribed and subscribed again when an input to the hook (such as `subscription` or `variables`) changes.
*/
shouldResubscribe?: boolean | ((options: BaseSubscriptionOptions<TData, TVariables>) => boolean);
/**
* An `ApolloClient` instance. By default `useSubscription` / `Subscription` uses the client passed down via context, but a different client can be passed in.
*/
client?: ApolloClient<object>;
/**
* Determines if the current subscription should be skipped. Useful if, for example, variables depend on previous queries and are not ready yet.
*/
skip?: boolean;
/**
* Shared context between your component and your network interface (Apollo Link).
*/
context?: DefaultContext;
/**
* Allows the registration of a callback function that will be triggered each time the `useSubscription` Hook / `Subscription` component completes the subscription.
*
* @since
*
* 3.7.0
*/
onComplete?: () => void;
/**
* Allows the registration of a callback function that will be triggered each time the `useSubscription` Hook / `Subscription` component receives data. The callback `options` object param consists of the current Apollo Client instance in `client`, and the received subscription data in `data`.
*
* @since
*
* 3.7.0
*/
onData?: (options: OnDataOptions<TData>) => any;
/**
* @deprecated Use onData instead
* Allows the registration of a callback function that will be triggered each time the `useSubscription` Hook / `Subscription` component receives data. The callback `options` object param consists of the current Apollo Client instance in `client`, and the received subscription data in `subscriptionData`.
*
* @deprecated
*
* Use `onData` instead
*/
onSubscriptionData?: (options: OnSubscriptionDataOptions<TData>) => any;
/**
* Allows the registration of a callback function that will be triggered each time the `useSubscription` Hook / `Subscription` component receives an error.
*
* @since
*
* 3.7.0
*/
onError?: (error: ApolloError) => void;
/**
* @deprecated Use onComplete instead
* Allows the registration of a callback function that will be triggered when the `useSubscription` Hook / `Subscription` component completes the subscription.
*
* @deprecated
*
* Use `onComplete` instead
*/

@@ -231,5 +714,17 @@ onSubscriptionComplete?: () => void;

export interface SubscriptionResult<TData = any, TVariables = any> {
/**
* A boolean that indicates whether any initial data has been returned
*/
loading: boolean;
/**
* An object containing the result of your GraphQL subscription. Defaults to an empty object.
*/
data?: TData;
/**
* A runtime error with `graphQLErrors` and `networkError` properties
*/
error?: ApolloError;
/**
* @internal
*/
variables?: TVariables;

@@ -236,0 +731,0 @@ }

@@ -14,2 +14,6 @@ <div align="center">

| ☑️ Apollo Client User Survey |
| :----- |
| What do you like best about Apollo Client? What needs to be improved? Please tell us by taking a [one-minute survey](https://docs.google.com/forms/d/e/1FAIpQLSczNDXfJne3ZUOXjk9Ursm9JYvhTh1_nFTDfdq3XBAFWCzplQ/viewform?usp=pp_url&entry.1170701325=Apollo+Client&entry.204965213=Readme). Your responses will help us understand Apollo Client usage and allow us to serve you better. |
## Documentation

@@ -16,0 +20,0 @@

@@ -94,4 +94,4 @@ 'use strict';

}
if (!response.result && !response.error) {
configError = new Error("Mocked response should contain either result or error: ".concat(key));
if (!response.result && !response.error && response.delay !== Infinity) {
configError = new Error("Mocked response should contain either `result`, `error` or a `delay` of `Infinity`: ".concat(key));
}

@@ -98,0 +98,0 @@ }

@@ -13,3 +13,3 @@ import type { Operation, GraphQLRequest, FetchResult } from "../../../link/core/index.js";

variableMatcher?: VariableMatcher<TVariables>;
newData?: ResultFunction<FetchResult>;
newData?: ResultFunction<FetchResult<TData>, TVariables>;
}

@@ -16,0 +16,0 @@ export interface MockLinkOptions {

@@ -91,4 +91,4 @@ import { __extends } from "tslib";

}
if (!response.result && !response.error) {
configError = new Error("Mocked response should contain either result or error: ".concat(key));
if (!response.result && !response.error && response.delay !== Infinity) {
configError = new Error("Mocked response should contain either `result`, `error` or a `delay` of `Infinity`: ".concat(key));
}

@@ -95,0 +95,0 @@ }

@@ -40,5 +40,5 @@ import { __asyncGenerator, __await, __awaiter, __extends, __generator } from "tslib";

}
IteratorStream.prototype.take = function (_a) {
var _b = _a === void 0 ? {} : _a, _c = _b.timeout, timeout = _c === void 0 ? 100 : _c;
return __awaiter(this, void 0, void 0, function () {
IteratorStream.prototype.take = function () {
return __awaiter(this, arguments, void 0, function (_a) {
var _b = _a === void 0 ? {} : _a, _c = _b.timeout, timeout = _c === void 0 ? 100 : _c;
return __generator(this, function (_d) {

@@ -45,0 +45,0 @@ return [2 /*return*/, Promise.race([

@@ -115,7 +115,7 @@ var _a, _b;

},
peekRender: function (options) {
if (options === void 0) { options = {}; }
return __awaiter(this, void 0, void 0, function () {
peekRender: function () {
return __awaiter(this, arguments, void 0, function (options) {
var render;
var _a;
if (options === void 0) { options = {}; }
return __generator(this, function (_b) {

@@ -133,7 +133,7 @@ if (iteratorPosition < Profiler.renders.length) {

},
takeRender: function (options) {
if (options === void 0) { options = {}; }
return __awaiter(this, void 0, void 0, function () {
takeRender: function () {
return __awaiter(this, arguments, void 0, function (options) {
var env_1, _disabledActWarnings, error, e_1, e_2;
var _a;
if (options === void 0) { options = {}; }
return __generator(this, function (_b) {

@@ -140,0 +140,0 @@ switch (_b.label) {

@@ -29,3 +29,3 @@ import { __makeTemplateObject, __spreadArray } from "tslib";

export function setupPaginatedCase() {
var query = gql(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n query letters($limit: Int, $offset: Int) {\n letters(limit: $limit) {\n letter\n position\n }\n }\n "], ["\n query letters($limit: Int, $offset: Int) {\n letters(limit: $limit) {\n letter\n position\n }\n }\n "])));
var query = gql(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n query LettersQuery($limit: Int, $offset: Int) {\n letters(limit: $limit, offset: $offset) {\n letter\n position\n }\n }\n "], ["\n query LettersQuery($limit: Int, $offset: Int) {\n letters(limit: $limit, offset: $offset) {\n letter\n position\n }\n }\n "])));
var data = "ABCDEFGHIJKLMNOPQRSTUV".split("").map(function (letter, index) { return ({

@@ -32,0 +32,0 @@ __typename: "Letter",

@@ -43,4 +43,4 @@ import { __assign, __spreadArray } from "tslib";

"inMemoryCache.maybeBroadcastWatch": 5000 /* defaultCacheSizes["inMemoryCache.maybeBroadcastWatch"] */,
"inMemoryCache.executeSelectionSet": 10000 /* defaultCacheSizes["inMemoryCache.executeSelectionSet"] */,
"inMemoryCache.executeSubSelectedArray": 5000 /* defaultCacheSizes["inMemoryCache.executeSubSelectedArray"] */,
"inMemoryCache.executeSelectionSet": 50000 /* defaultCacheSizes["inMemoryCache.executeSelectionSet"] */,
"inMemoryCache.executeSubSelectedArray": 10000 /* defaultCacheSizes["inMemoryCache.executeSubSelectedArray"] */,
};

@@ -47,0 +47,0 @@ return Object.fromEntries(Object.entries(defaults).map(function (_a) {

@@ -307,6 +307,6 @@ declare global {

"inMemoryCache.maybeBroadcastWatch" = 5000,
"inMemoryCache.executeSelectionSet" = 10000,
"inMemoryCache.executeSubSelectedArray" = 5000
"inMemoryCache.executeSelectionSet" = 50000,
"inMemoryCache.executeSubSelectedArray" = 10000
}
export {};
//# sourceMappingURL=sizes.d.ts.map

@@ -7,3 +7,3 @@ 'use strict';

var version = "0.0.0-pr-11465-20240125173354";
var version = "0.0.0-pr-11465-20240315183534";

@@ -10,0 +10,0 @@ function maybe(thunk) {

@@ -5,3 +5,15 @@ import type { DocumentNode } from "graphql";

interface DocumentTransformOptions {
/**
* Determines whether to cache the transformed GraphQL document. Caching can speed up repeated calls to the document transform for the same input document. Set to `false` to completely disable caching for the document transform. When disabled, this option takes precedence over the [`getCacheKey`](#getcachekey) option.
*
* The default value is `true`.
*/
cache?: boolean;
/**
* Defines a custom cache key for a GraphQL document that will determine whether to re-run the document transform when given the same input GraphQL document. Returns an array that defines the cache key. Return `undefined` to disable caching for that GraphQL document.
*
* > **Note:** The items in the array may be any type, but also need to be referentially stable to guarantee a stable cache key.
*
* The default implementation of this function returns the `document` as the cache key.
*/
getCacheKey?: (document: DocumentNode) => DocumentTransformCacheKey | undefined;

@@ -8,0 +20,0 @@ }

@@ -183,6 +183,6 @@ 'use strict';

function readMultipartBody(response, nextValue) {
var _a;
return tslib.__awaiter(this, void 0, void 0, function () {
var decoder, contentType, delimiter, boundaryVal, boundary, buffer, iterator, running, _b, value, done, chunk, searchFrom, bi, message, i, headers, contentType_1, body, result, next;
var _c, _d;
var decoder, contentType, delimiter, boundaryVal, boundary, buffer, iterator, running, _a, value, done, chunk, searchFrom, bi, message, i, headers, contentType_1, body, result, next;
var _b, _c;
var _d;
return tslib.__generator(this, function (_e) {

@@ -195,3 +195,3 @@ switch (_e.label) {

decoder = new TextDecoder("utf-8");
contentType = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get("content-type");
contentType = (_d = response.headers) === null || _d === void 0 ? void 0 : _d.get("content-type");
delimiter = "boundary=";

@@ -210,3 +210,3 @@ boundaryVal = (contentType === null || contentType === void 0 ? void 0 : contentType.includes(delimiter)) ?

case 2:
_b = _e.sent(), value = _b.value, done = _b.done;
_a = _e.sent(), value = _a.value, done = _a.done;
chunk = typeof value === "string" ? value : decoder.decode(value);

@@ -219,6 +219,6 @@ searchFrom = buffer.length - boundary.length + 1;

message = void 0;
_c = [
_b = [
buffer.slice(0, bi),
buffer.slice(bi + boundary.length),
], message = _c[0], buffer = _c[1];
], message = _b[0], buffer = _b[1];
i = message.indexOf("\r\n\r\n");

@@ -242,6 +242,9 @@ headers = parseHeaders(message.slice(0, i));

if ("payload" in result) {
if (Object.keys(result).length === 1 && result.payload === null) {
return [2 ];
}
next = tslib.__assign({}, result.payload);
}
if ("errors" in result) {
next = tslib.__assign(tslib.__assign({}, next), { extensions: tslib.__assign(tslib.__assign({}, ("extensions" in next ? next.extensions : null)), (_d = {}, _d[errors.PROTOCOL_ERRORS_SYMBOL] = result.errors, _d)) });
next = tslib.__assign(tslib.__assign({}, next), { extensions: tslib.__assign(tslib.__assign({}, ("extensions" in next ? next.extensions : null)), (_c = {}, _c[errors.PROTOCOL_ERRORS_SYMBOL] = result.errors, _c)) });
}

@@ -248,0 +251,0 @@ nextValue(next);

@@ -182,6 +182,6 @@ 'use strict';

function readMultipartBody(response, nextValue) {
var _a;
return tslib.__awaiter(this, void 0, void 0, function () {
var decoder, contentType, delimiter, boundaryVal, boundary, buffer, iterator, running, _b, value, done, chunk, searchFrom, bi, message, i, headers, contentType_1, body, result, next;
var _c, _d;
var decoder, contentType, delimiter, boundaryVal, boundary, buffer, iterator, running, _a, value, done, chunk, searchFrom, bi, message, i, headers, contentType_1, body, result, next;
var _b, _c;
var _d;
return tslib.__generator(this, function (_e) {

@@ -194,3 +194,3 @@ switch (_e.label) {

decoder = new TextDecoder("utf-8");
contentType = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get("content-type");
contentType = (_d = response.headers) === null || _d === void 0 ? void 0 : _d.get("content-type");
delimiter = "boundary=";

@@ -209,3 +209,3 @@ boundaryVal = (contentType === null || contentType === void 0 ? void 0 : contentType.includes(delimiter)) ?

case 2:
_b = _e.sent(), value = _b.value, done = _b.done;
_a = _e.sent(), value = _a.value, done = _a.done;
chunk = typeof value === "string" ? value : decoder.decode(value);

@@ -218,6 +218,6 @@ searchFrom = buffer.length - boundary.length + 1;

message = void 0;
_c = [
_b = [
buffer.slice(0, bi),
buffer.slice(bi + boundary.length),
], message = _c[0], buffer = _c[1];
], message = _b[0], buffer = _b[1];
i = message.indexOf("\r\n\r\n");

@@ -241,6 +241,9 @@ headers = parseHeaders(message.slice(0, i));

if ("payload" in result) {
if (Object.keys(result).length === 1 && result.payload === null) {
return [2 ];
}
next = tslib.__assign({}, result.payload);
}
if ("errors" in result) {
next = tslib.__assign(tslib.__assign({}, next), { extensions: tslib.__assign(tslib.__assign({}, ("extensions" in next ? next.extensions : null)), (_d = {}, _d[errors.PROTOCOL_ERRORS_SYMBOL] = result.errors, _d)) });
next = tslib.__assign(tslib.__assign({}, next), { extensions: tslib.__assign(tslib.__assign({}, ("extensions" in next ? next.extensions : null)), (_c = {}, _c[errors.PROTOCOL_ERRORS_SYMBOL] = result.errors, _c)) });
}

@@ -247,0 +250,0 @@ nextValue(next);

@@ -1,2 +0,2 @@

export var version = "0.0.0-pr-11465-20240125173354";
export var version = "0.0.0-pr-11465-20240315183534";
//# sourceMappingURL=version.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc