UNPKG

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