Skip to content

Commit 96941dd

Browse files
authored
Add useLazyQuery hook (rubengrill#21)
1 parent d5d5174 commit 96941dd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/reactHooks.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ declare module "@apollo/react-hooks" {
55
} from "apollo-typed-documents";
66
import { QueryResult } from "@apollo/react-common";
77
import {
8+
LazyQueryHookOptions,
89
MutationHookOptions,
910
MutationTuple,
1011
QueryHookOptions,
12+
QueryTuple,
1113
SubscriptionHookOptions,
1214
} from "@apollo/react-hooks/lib/types";
1315

@@ -22,6 +24,15 @@ declare module "@apollo/react-hooks" {
2224
options?: TOptions
2325
): QueryResult<TData, TVariables>;
2426

27+
export function useLazyQuery<
28+
TData,
29+
TVariables extends OperationVariables,
30+
TOptions extends LazyQueryHookOptions<TData, TVariables>
31+
>(
32+
query: TypedDocumentNode<TVariables, TData>,
33+
options?: TOptions
34+
): QueryTuple<TData, TVariables>;
35+
2536
export function useMutation<
2637
TData,
2738
TVariables extends OperationVariables,

0 commit comments

Comments
 (0)