/// import * as React from 'react'; import ApolloClient, { ApolloQueryResult, ApolloError, FetchMoreOptions, UpdateQueryOptions, FetchMoreQueryOptions, FetchPolicy, ApolloCurrentResult } from 'apollo-client'; import { DocumentNode } from 'graphql'; import { OperationVariables } from './types'; export interface QueryResult { client: ApolloClient; data: TData; error?: ApolloError; fetchMore: (fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions) => Promise>; loading: boolean; networkStatus: number; refetch: (variables?: OperationVariables) => Promise>; startPolling: (pollInterval: number) => void; stopPolling: () => void; updateQuery: (mapFn: (previousQueryResult: any, options: UpdateQueryOptions) => any) => void; } export interface QueryProps { children: (result: QueryResult) => React.ReactNode; fetchPolicy?: FetchPolicy; notifyOnNetworkStatusChange?: boolean; pollInterval?: number; query: DocumentNode; variables?: OperationVariables; } export interface QueryState { result: ApolloCurrentResult; } declare class Query extends React.Component, QueryState> { static contextTypes: { client: any; }; state: QueryState; private client; private queryObservable; private querySubscription; constructor(props: QueryProps, context: any); componentDidMount(): void; componentWillReceiveProps(nextProps: any, nextContext: any): void; componentWillUnmount(): void; render(): React.ReactNode; private initializeQueryObservable; private startQuerySubscription; private removeQuerySubscription; private updateCurrentData; private getQueryResult; } export default Query;