1 | import { DocumentNode, GraphQLError } from 'graphql';
|
2 | import { Cache } from '../cache';
|
3 | import { WatchQueryOptions, ErrorPolicy } from './watchQueryOptions';
|
4 | import { ObservableQuery } from './ObservableQuery';
|
5 | import { QueryListener } from './types';
|
6 | import { FetchResult } from '../link/core';
|
7 | import { ObservableSubscription } from '../utilities';
|
8 | import { NetworkStatus } from './networkStatus';
|
9 | import { ApolloError } from '../errors';
|
10 | import { QueryManager } from './QueryManager';
|
11 | export type QueryStoreValue = Pick<QueryInfo, "variables" | "networkStatus" | "networkError" | "graphQLErrors">;
|
12 | export declare const enum CacheWriteBehavior {
|
13 | FORBID = 0,
|
14 | OVERWRITE = 1,
|
15 | MERGE = 2
|
16 | }
|
17 | export declare class QueryInfo {
|
18 | readonly queryId: string;
|
19 | listeners: Set<QueryListener>;
|
20 | document: DocumentNode | null;
|
21 | lastRequestId: number;
|
22 | subscriptions: Set<ObservableSubscription>;
|
23 | variables?: Record<string, any>;
|
24 | networkStatus?: NetworkStatus;
|
25 | networkError?: Error | null;
|
26 | graphQLErrors?: ReadonlyArray<GraphQLError>;
|
27 | stopped: boolean;
|
28 | private cache;
|
29 | constructor(queryManager: QueryManager<any>, queryId?: string);
|
30 | init(query: {
|
31 | document: DocumentNode;
|
32 | variables: Record<string, any> | undefined;
|
33 | networkStatus?: NetworkStatus;
|
34 | observableQuery?: ObservableQuery<any>;
|
35 | lastRequestId?: number;
|
36 | }): this;
|
37 | private dirty;
|
38 | private notifyTimeout?;
|
39 | reset(): void;
|
40 | getDiff(variables?: Record<string, any> | undefined): Cache.DiffResult<any>;
|
41 | private lastDiff?;
|
42 | private updateLastDiff;
|
43 | private getDiffOptions;
|
44 | setDiff(diff: Cache.DiffResult<any> | null): void;
|
45 | readonly observableQuery: ObservableQuery<any> | null;
|
46 | private oqListener?;
|
47 | setObservableQuery(oq: ObservableQuery<any> | null): void;
|
48 | notify(): void;
|
49 | private shouldNotify;
|
50 | stop(): void;
|
51 | private cancel;
|
52 | private lastWatch?;
|
53 | private updateWatch;
|
54 | private lastWrite?;
|
55 | resetLastWrite(): void;
|
56 | private shouldWrite;
|
57 | markResult<T>(result: FetchResult<T>, document: DocumentNode, options: Pick<WatchQueryOptions, "variables" | "fetchPolicy" | "errorPolicy">, cacheWriteBehavior: CacheWriteBehavior): void;
|
58 | markReady(): NetworkStatus;
|
59 | markError(error: ApolloError): ApolloError;
|
60 | }
|
61 | export declare function shouldWriteResult<T>(result: FetchResult<T>, errorPolicy?: ErrorPolicy): boolean;
|
62 | //# sourceMappingURL=QueryInfo.d.ts.map |
\ | No newline at end of file |