Skip to content

Commit 91a5f42

Browse files
M-ZuberAkryum
authored andcommitted
fix(types): The typings for DollarApollo where missing getClient (#727)
* fix(types): add getClient to DollarApollo * Add documentation for `DollarApollo.getClient`
1 parent 3e7bfe1 commit 91a5f42

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/api/dollar-apollo.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ This is the Apollo manager added to any component that uses Apollo. It can be ac
1919
- `mutate`: execute a mutation (see [Mutations](../guide/apollo/mutations.md)).
2020
- `subscribe`: standard Apollo subscribe method (see [Subscriptions](../guide/apollo/subscriptions.md)).
2121
- `addSmartQuery`: manually add a Smart Query (not recommended).
22-
- `addSmartSubscription`: add a Smart Subscription (see [Subscriptions](../guide/apollo/subscriptions.md)).
22+
- `addSmartSubscription`: add a Smart Subscription (see [Subscriptions](../guide/apollo/subscriptions.md)).
23+
- `getClient`: returns the underlying ApolloClient.

types/vue-apollo.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export interface DollarApollo<V> {
5353
/* writeonly */ skipAllSubscriptions: boolean;
5454
/* writeonly */ skipAll: boolean;
5555

56+
getClient<R=any>(): ApolloClient<R>;
5657
query<R=any>(options: VueApolloQueryOptions<V, R>): Promise<ApolloQueryResult<R>>;
5758
mutate<R=any>(options: VueApolloMutationOptions<V, R>): Promise<FetchResult<R>>;
5859
subscribe<R=any>(options: VueApolloSubscriptionOptions<V, R>): Observable<FetchResult<R>>;
@@ -61,4 +62,4 @@ export interface DollarApollo<V> {
6162
addSmartSubscription<R=any>(key: string, options: VueApolloSubscriptionOptions<V, R>): SmartSubscription<V>;
6263
}
6364

64-
export function willPrefetch (component: VueApolloComponent, contextCallback?: boolean): VueApolloComponent
65+
export function willPrefetch (component: VueApolloComponent, contextCallback?: boolean): VueApolloComponent

0 commit comments

Comments
 (0)