UNPKG

1.28 kBTypeScriptView Raw
1import { DocumentNode, GraphQLError, ExecutionResult } from 'graphql';
2import { NetworkStatus } from '../core/networkStatus';
3export declare type QueryStoreValue = {
4 document: DocumentNode;
5 variables: Object;
6 previousVariables?: Object | null;
7 networkStatus: NetworkStatus;
8 networkError?: Error | null;
9 graphQLErrors?: ReadonlyArray<GraphQLError>;
10 metadata: any;
11};
12export declare class QueryStore {
13 private store;
14 getStore(): {
15 [queryId: string]: QueryStoreValue;
16 };
17 get(queryId: string): QueryStoreValue;
18 initQuery(query: {
19 queryId: string;
20 document: DocumentNode;
21 storePreviousVariables: boolean;
22 variables: Object;
23 isPoll: boolean;
24 isRefetch: boolean;
25 metadata: any;
26 fetchMoreForQueryId: string | undefined;
27 }): void;
28 markQueryResult(queryId: string, result: ExecutionResult, fetchMoreForQueryId: string | undefined): void;
29 markQueryError(queryId: string, error: Error, fetchMoreForQueryId: string | undefined): void;
30 markQueryResultClient(queryId: string, complete: boolean): void;
31 stopQuery(queryId: string): void;
32 reset(observableQueryIds: string[]): void;
33}
34//# sourceMappingURL=queries.d.ts.map
\No newline at end of file