UNPKG

apollo-mobx

Version:

HOC for querying graphql server

22 lines (21 loc) 1.01 kB
import ApolloClientBase from 'apollo-client'; import { ReactWrapper } from 'enzyme'; import { ApolloClient } from '../client/client'; export interface ApolloProps<T> { resolvers?: any; typeDefs?: string; queries?: any; mutations?: any; reducers?: {}; context?: T; loadingComponent?: (props: any) => JSX.Element; } export declare function configure(schema: string, resolver: any): void; export declare function initialiseApolloMocks<T>({queries, mutations, resolvers, reducers, typeDefs, context, loadingComponent}: ApolloProps<T>): ApolloClient<T>; export declare function initialiseApolloDecorator<T>({queries, mutations, resolvers, reducers, typeDefs, context, loadingComponent}: ApolloProps<T>): { ApolloDecorator: ({children}: any) => JSX.Element; client: ApolloClient<T>; context: T; }; export declare function mountContainer(component: JSX.Element): Promise<ReactWrapper<any, any>>; export declare function waitForQueries(client: ApolloClientBase<any>): Promise<any>;