From 4e88b05b576ae700088145c6cb6ac3aa7d5fcbe3 Mon Sep 17 00:00:00 2001 From: sztadii Date: Thu, 13 Jan 2022 23:04:14 +0400 Subject: [PATCH] Correct useLazyQuery types --- src/react/hooks/useLazyQuery.ts | 6 ++---- src/react/types/types.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/react/hooks/useLazyQuery.ts b/src/react/hooks/useLazyQuery.ts index 0f3e0ae688e..5e8a6891d3c 100644 --- a/src/react/hooks/useLazyQuery.ts +++ b/src/react/hooks/useLazyQuery.ts @@ -80,8 +80,7 @@ export function useLazyQuery( loading: false, data: void 0 as unknown as TData, error: void 0, - // TODO: fix the type of result - called: false as any, + called: false, }; @@ -94,6 +93,5 @@ export function useLazyQuery( } } - // TODO: fix the type of result - return [execute, result as LazyQueryResult]; + return [execute, result]; } diff --git a/src/react/types/types.ts b/src/react/types/types.ts index 4f3bc908aac..f74817d8117 100644 --- a/src/react/types/types.ts +++ b/src/react/types/types.ts @@ -78,7 +78,7 @@ export interface QueryResult error?: ApolloError; loading: boolean; networkStatus: NetworkStatus; - called: true; + called: boolean; } export interface QueryDataOptions