import type { DocumentNode } from "graphql"; import type { ApolloLink, FetchResult } from "../link/core/index.js"; import type { Cache, ApolloCache } from "../cache/index.js"; import { Observable, DocumentTransform } from "../utilities/index.js"; import type { QueryOptions, WatchQueryOptions, SubscriptionOptions, MutationOptions, ErrorPolicy, MutationFetchPolicy } from "./watchQueryOptions.js"; import { ObservableQuery } from "./ObservableQuery.js"; import { NetworkStatus } from "./networkStatus.js"; import type { ApolloQueryResult, OperationVariables, MutationUpdaterFunction, OnQueryUpdated, InternalRefetchQueriesInclude, InternalRefetchQueriesOptions, InternalRefetchQueriesMap, DefaultContext } from "./types.js"; import type { LocalState } from "./LocalState.js"; import type { QueryStoreValue } from "./QueryInfo.js"; interface MutationStoreValue { mutation: DocumentNode; variables: Record; loading: boolean; error: Error | null; } type UpdateQueries = MutationOptions["updateQueries"]; interface TransformCacheEntry { hasClientExports: boolean; hasForcedResolvers: boolean; hasNonreactiveDirective: boolean; clientQuery: DocumentNode | null; serverQuery: DocumentNode | null; defaultVars: OperationVariables; asQuery: DocumentNode; } import type { DefaultOptions } from "./ApolloClient.js"; import { Trie } from "@wry/trie"; export interface QueryManagerOptions { cache: ApolloCache; link: ApolloLink; defaultOptions: DefaultOptions; documentTransform: DocumentTransform | null | undefined; queryDeduplication: boolean; onBroadcast: undefined | (() => void); ssrMode: boolean; clientAwareness: Record; localState: LocalState; assumeImmutableResults: boolean; defaultContext: Partial | undefined; } export declare class QueryManager { cache: ApolloCache; link: ApolloLink; defaultOptions: DefaultOptions; readonly assumeImmutableResults: boolean; readonly documentTransform: DocumentTransform; readonly ssrMode: boolean; readonly defaultContext: Partial; private queryDeduplication; private clientAwareness; private localState; private onBroadcast?; mutationStore?: { [mutationId: string]: MutationStoreValue; }; private queries; protected fetchCancelFns: Map any>; constructor(options: QueryManagerOptions); /** * Call this method to terminate any active query processes, making it safe * to dispose of this QueryManager instance. */ stop(): void; private cancelPendingFetches; mutate, TCache extends ApolloCache>({ mutation, variables, optimisticResponse, updateQueries, refetchQueries, awaitRefetchQueries, update: updateWithProxyFn, onQueryUpdated, fetchPolicy, errorPolicy, keepRootFields, context, }: MutationOptions): Promise>; markMutationResult>(mutation: { mutationId: string; result: FetchResult; document: DocumentNode; variables?: TVariables; fetchPolicy?: MutationFetchPolicy; errorPolicy: ErrorPolicy; context?: TContext; updateQueries: UpdateQueries; update?: MutationUpdaterFunction; awaitRefetchQueries?: boolean; refetchQueries?: InternalRefetchQueriesInclude; removeOptimistic?: string; onQueryUpdated?: OnQueryUpdated; keepRootFields?: boolean; }, cache?: ApolloCache): Promise>; markMutationOptimistic>(optimisticResponse: any, mutation: { mutationId: string; document: DocumentNode; variables?: TVariables; fetchPolicy?: MutationFetchPolicy; errorPolicy: ErrorPolicy; context?: TContext; updateQueries: UpdateQueries; update?: MutationUpdaterFunction; keepRootFields?: boolean; }): boolean; fetchQuery(queryId: string, options: WatchQueryOptions, networkStatus?: NetworkStatus): Promise>; getQueryStore(): Record; resetErrors(queryId: string): void; transform(document: DocumentNode): DocumentNode; private transformCache; getDocumentInfo(document: DocumentNode): TransformCacheEntry; private getVariables; watchQuery(options: WatchQueryOptions): ObservableQuery; query(options: QueryOptions, queryId?: string): Promise>; private queryIdCounter; generateQueryId(): string; private requestIdCounter; generateRequestId(): number; private mutationIdCounter; generateMutationId(): string; stopQueryInStore(queryId: string): void; private stopQueryInStoreNoBroadcast; clearStore(options?: Cache.ResetOptions): Promise; getObservableQueries(include?: InternalRefetchQueriesInclude): Map>; reFetchObservableQueries(includeStandby?: boolean): Promise[]>; setObservableQuery(observableQuery: ObservableQuery): void; startGraphQLSubscription({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable>; stopQuery(queryId: string): void; private stopQueryNoBroadcast; removeQuery(queryId: string): void; broadcastQueries(): void; getLocalState(): LocalState; protected inFlightLinkObservables: Trie<{ observable?: Observable>; }>; private getObservableFromLink; private getResultsFromLink; private fetchConcastWithInfo; refetchQueries({ updateCache, include, optimistic, removeOptimistic, onQueryUpdated, }: InternalRefetchQueriesOptions, TResult>): InternalRefetchQueriesMap; private fetchQueryByPolicy; private getQuery; private prepareContext; } export {}; //# sourceMappingURL=QueryManager.d.ts.map