UNPKG

@apollo-orbit/angular

Version:

A fully-featured GraphQL client for Angular with modular state management.

24 lines (23 loc) 1.54 kB
import { ApolloClient, MutationOptions, SubscriptionOptions, OperationVariables as Variables, WatchFragmentOptions, WatchFragmentResult } from '@apollo/client/core'; import { Observable } from 'rxjs'; import { ApolloCacheEx } from './cacheEx'; import { QueryObservable } from './queryObservable'; import type { DefaultOptions, MutationResult, QueryOptions, QueryResult, SubscriptionResult, WatchQueryOptions } from './types'; import * as i0 from "@angular/core"; export declare class Apollo<TCacheShape = any> { /** * Instance of ApolloClient */ readonly client: ApolloClient<TCacheShape>; private readonly defaultOptions?; private readonly _cache; constructor(client: ApolloClient<TCacheShape>, defaultOptions?: DefaultOptions); query<T = any, V extends Variables = Variables>(options: QueryOptions<V, T>): Observable<QueryResult<T>>; watchQuery<T = any, V extends Variables = Variables>(options: WatchQueryOptions<V, T>): QueryObservable<T, V>; watchFragment<T = any, V extends Variables = Variables>(options: WatchFragmentOptions<T, V>): Observable<WatchFragmentResult<T>>; mutate<T = any, V extends Variables = Variables>(options: MutationOptions<T, V>): Observable<MutationResult<T>>; subscribe<T = any, V extends Variables = Variables>(options: SubscriptionOptions<V, T>): Observable<SubscriptionResult<T>>; get cache(): ApolloCacheEx<TCacheShape>; static ɵfac: i0.ɵɵFactoryDeclaration<Apollo<any>, never>; static ɵprov: i0.ɵɵInjectableDeclaration<Apollo<any>>; }