mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add graphql peer dependencies Apollo has a peer dependency on graphql, but several DT packages don't install it. This fixes that. * Bump required TS version to 2.8 * Bump version to 3.0
30 lines
777 B
TypeScript
30 lines
777 B
TypeScript
// Type definitions for mobx-apollo 0.0
|
|
// Project: https://github.com/sonaye/mobx-apollo#readme
|
|
// Definitions by: Paul Selden <https://github.com/pselden>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 3.0
|
|
|
|
import {
|
|
ApolloClient,
|
|
ObservableQuery,
|
|
WatchQueryOptions,
|
|
ApolloError
|
|
} from 'apollo-client';
|
|
|
|
export interface MobxApolloQueryOptions<T> extends WatchQueryOptions {
|
|
client: ApolloClient<any>;
|
|
onFetch?: (result: T) => void;
|
|
onError?: (error: ApolloError) => void;
|
|
}
|
|
|
|
export interface MobxApolloQuery<T> {
|
|
loading: boolean;
|
|
data?: T;
|
|
error?: ApolloError;
|
|
ref: ObservableQuery<T>;
|
|
}
|
|
|
|
export default function graphql<T>(
|
|
options: MobxApolloQueryOptions<T>
|
|
): MobxApolloQuery<T>;
|