// @flow import type { DocumentNode } from 'graphql'; import type { ApolloClient, ApolloCurrentResult, ApolloError, ApolloExecutionResult, ApolloQueryResult, FetchMoreOptions, FetchMoreQueryOptions, FetchPolicy, ModifiableWatchQueryOptions, NetworkStatus, ObservableQuery, SubscribeToMoreOptions, Subscription, UpdateQueryOptions, WatchQueryOptions, } from 'apollo-client'; export type FragmentInitializerResult = ?T | false; export type FragmentResult = ?T; export type QueryResult = ApolloQueryResult; export type MutationResult = ApolloExecutionResult; export type CurrentQueryResult = { data: T, error: ?$PropertyType, 'error'>, loading: $PropertyType, 'loading'>, networkStatus: $PropertyType, 'networkStatus'>, partial: ?$PropertyType, 'partial'>, }; export type ReactApolloGraphQLObservableQuery = { options: WatchQueryOptions, queryId: string, variables: { [key: string]: any, }, result(): Promise>, currentResult(): CurrentQueryResult, getLastResult(): QueryResult, refetch(variables?: any): Promise>, fetchMore(fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions): Promise>, subscribeToMore(options: SubscribeToMoreOptions): () => void, setOptions(opts: ModifiableWatchQueryOptions): Promise>, setVariables(variables: any, tryFetch?: boolean): Promise>, updateQuery(mapFn: (previousQueryResult: any, options: UpdateQueryOptions) => any): void, stopPolling(): void, startPolling(pollInterval: number): void, }; /* * Helper type used if you need to annotate type for arguments passed from render queries arg */ export type ResultTypeToResultObject = { data: $PropertyType(V) => ?V>>, 'data'>, error: $PropertyType(V) => ?V>>, 'error'>, loading: $PropertyType(V) => ?V>>, 'loading'>, networkStatus: $PropertyType(V) => ?V>>, 'networkStatus'>, observer: ReactApolloGraphQLObservableQuery, partial: $PropertyType(V) => ?V>>, 'partial'>, }; export type { ApolloError, ApolloClient, ObservableQuery, Subscription };