UNPKG

1.15 kBTypeScriptView Raw
1import { DocumentNode, GraphQLError } from 'graphql';
2import { QueryStoreValue } from '../data/queries';
3import { NetworkStatus } from './networkStatus';
4import { FetchResult } from 'apollo-link';
5export declare type QueryListener = (queryStoreValue: QueryStoreValue, newData?: any) => void;
6export declare type OperationVariables = {
7 [key: string]: any;
8};
9export declare type PureQueryOptions = {
10 query: DocumentNode;
11 variables?: {
12 [key: string]: any;
13 };
14 context?: any;
15};
16export declare type ApolloQueryResult<T> = {
17 data: T;
18 errors?: GraphQLError[];
19 loading: boolean;
20 networkStatus: NetworkStatus;
21 stale: boolean;
22};
23export declare enum FetchType {
24 normal = 1,
25 refetch = 2,
26 poll = 3
27}
28export declare type MutationQueryReducer<T> = (previousResult: Record<string, any>, options: {
29 mutationResult: FetchResult<T>;
30 queryName: string | undefined;
31 queryVariables: Record<string, any>;
32}) => Record<string, any>;
33export declare type MutationQueryReducersMap<T = {
34 [key: string]: any;
35}> = {
36 [queryName: string]: MutationQueryReducer<T>;
37};
38//# sourceMappingURL=types.d.ts.map
\No newline at end of file