1 | import { Observable } from 'rxjs';
|
2 | import { NgZone } from '@angular/core';
|
3 | import type { ApolloError, ApolloQueryResult, FetchMoreQueryOptions, ObservableQuery, OperationVariables, SubscribeToMoreOptions, TypedDocumentNode, UpdateQueryOptions } from '@apollo/client/core';
|
4 | import { EmptyObject, WatchQueryOptions } from './types';
|
5 | export type QueryRefFromDocument<T extends TypedDocumentNode> = T extends TypedDocumentNode<infer R, infer V> ? QueryRef<R, V & OperationVariables> : never;
|
6 | export declare class QueryRef<T, V extends OperationVariables = EmptyObject> {
|
7 | private readonly obsQuery;
|
8 | valueChanges: Observable<ApolloQueryResult<T>>;
|
9 | queryId: ObservableQuery<T, V>['queryId'];
|
10 | constructor(obsQuery: ObservableQuery<T, V>, ngZone: NgZone, options: WatchQueryOptions<V, T>);
|
11 | get options(): import("@apollo/client/core").WatchQueryOptions<V, T>;
|
12 | get variables(): V;
|
13 | result(): Promise<ApolloQueryResult<T>>;
|
14 | getCurrentResult(): ApolloQueryResult<T>;
|
15 | getLastResult(): ApolloQueryResult<T> | undefined;
|
16 | getLastError(): ApolloError | undefined;
|
17 | resetLastResults(): void;
|
18 | refetch(variables?: V): Promise<ApolloQueryResult<T>>;
|
19 | fetchMore<K = V>(fetchMoreOptions: FetchMoreQueryOptions<K, T>): Promise<ApolloQueryResult<T>>;
|
20 | subscribeToMore<MT = any, MV = EmptyObject>(options: SubscribeToMoreOptions<T, MV, MT>): () => void;
|
21 | updateQuery(mapFn: (previousQueryResult: T, options: UpdateQueryOptions<V>) => T): void;
|
22 | stopPolling(): void;
|
23 | startPolling(pollInterval: number): void;
|
24 | setOptions(opts: any): Promise<ApolloQueryResult<T>>;
|
25 | setVariables(variables: V): Promise<void | ApolloQueryResult<T>>;
|
26 | }
|