0.0.4 • Published 3 years ago

@types/mobx-apollo v0.0.4

Weekly downloads
10
License
MIT
Repository
github
Last release
3 years ago

Installation

npm install --save @types/mobx-apollo

Summary

This package contains type definitions for mobx-apollo (https://github.com/sonaye/mobx-apollo#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mobx-apollo.

index.d.ts

// 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) | undefined;
    onError?: ((error: ApolloError) => void) | undefined;
}

export interface MobxApolloQuery<T> {
    loading: boolean;
    data?: T | undefined;
    error?: ApolloError | undefined;
    ref: ObservableQuery<T>;
}

export default function graphql<T>(
    options: MobxApolloQueryOptions<T>
): MobxApolloQuery<T>;

Additional Details

Credits

These definitions were written by Paul Selden.

0.0.4

3 years ago

0.0.3

5 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago