import { ApolloLink, FetchResult } from 'apollo-link'; import { DocumentNode } from 'graphql'; import { Cache } from 'apollo-cache'; import { Observer, Subscription, Observable } from '../util/Observable'; import { DataStore } from '../data/store'; import { MutationStore } from '../data/mutations'; import { QueryStore } from '../data/queries'; import { QueryOptions, WatchQueryOptions, SubscriptionOptions, MutationOptions } from './watchQueryOptions'; import { ObservableQuery } from './ObservableQuery'; import { QueryListener, ApolloQueryResult, FetchType, OperationVariables } from './types'; import { LocalState } from './LocalState'; export interface QueryInfo { listeners: Set; invalidated: boolean; newData: Cache.DiffResult | null; document: DocumentNode | null; lastRequestId: number; observableQuery: ObservableQuery | null; subscriptions: Set; cancel?: () => void; } export declare class QueryManager { link: ApolloLink; mutationStore: MutationStore; queryStore: QueryStore; dataStore: DataStore; readonly assumeImmutableResults: boolean; private queryDeduplication; private clientAwareness; private localState; private onBroadcast; private ssrMode; private idCounter; private queries; private fetchQueryRejectFns; constructor({ link, queryDeduplication, store, onBroadcast, ssrMode, clientAwareness, localState, assumeImmutableResults, }: { link: ApolloLink; queryDeduplication?: boolean; store: DataStore; onBroadcast?: () => void; ssrMode?: boolean; clientAwareness?: Record; localState?: LocalState; assumeImmutableResults?: boolean; }); stop(): void; mutate({ mutation, variables, optimisticResponse, updateQueries: updateQueriesByName, refetchQueries, awaitRefetchQueries, update: updateWithProxyFn, errorPolicy, fetchPolicy, context, }: MutationOptions): Promise>; fetchQuery(queryId: string, options: WatchQueryOptions, fetchType?: FetchType, fetchMoreForQueryId?: string): Promise>; private markQueryResult; queryListenerForObserver(queryId: string, options: WatchQueryOptions, observer: Observer>): QueryListener; private transformCache; transform(document: DocumentNode): Readonly<{ document: Readonly; hasClientExports: boolean; hasForcedResolvers: boolean; clientQuery: Readonly | null; serverQuery: Readonly | null; defaultVars: Readonly; }>; private getVariables; watchQuery(options: WatchQueryOptions, shouldSubscribe?: boolean): ObservableQuery; query(options: QueryOptions): Promise>; generateQueryId(): string; stopQueryInStore(queryId: string): void; private stopQueryInStoreNoBroadcast; addQueryListener(queryId: string, listener: QueryListener): void; updateQueryWatch(queryId: string, document: DocumentNode, options: WatchQueryOptions): () => void; addObservableQuery(queryId: string, observableQuery: ObservableQuery): void; removeObservableQuery(queryId: string): void; clearStore(): Promise; resetStore(): Promise[]>; reFetchObservableQueries(includeStandby?: boolean): Promise[]>; observeQuery(queryId: string, options: WatchQueryOptions, observer: Observer>): Promise, Record>>; startQuery(queryId: string, options: WatchQueryOptions, listener: QueryListener): string; startGraphQLSubscription({ query, fetchPolicy, variables, }: SubscriptionOptions): Observable>; stopQuery(queryId: string): void; private stopQueryNoBroadcast; removeQuery(queryId: string): void; getCurrentQueryResult(observableQuery: ObservableQuery, optimistic?: boolean): { data: T | undefined; partial: boolean; }; getQueryWithPreviousResult(queryIdOrObservable: string | ObservableQuery): { previousResult: any; variables: TVariables | undefined; document: DocumentNode; }; broadcastQueries(): void; getLocalState(): LocalState; private inFlightLinkObservables; private getObservableFromLink; private fetchRequest; private getQuery; private setQuery; private invalidate; private prepareContext; checkInFlight(queryId: string): boolean; private pollingInfoByQueryId; startPollingQuery(options: WatchQueryOptions, queryId: string, listener?: QueryListener): string; stopPollingQuery(queryId: string): void; } //# sourceMappingURL=QueryManager.d.ts.map