Skip to content

Commit

Permalink
Correct useLazyQuery types (#9304)
Browse files Browse the repository at this point in the history
  • Loading branch information
sztadii authored Jan 19, 2022
1 parent efc9d38 commit 50ca93e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/react/hooks/useLazyQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ export function useLazyQuery<TData = any, TVariables = OperationVariables>(
loading: false,
data: void 0 as unknown as TData,
error: void 0,
// TODO: fix the type of result
called: false as any,
called: false,
};


Expand All @@ -94,6 +93,5 @@ export function useLazyQuery<TData = any, TVariables = OperationVariables>(
}
}

// TODO: fix the type of result
return [execute, result as LazyQueryResult<TData, TVariables>];
return [execute, result];
}
2 changes: 1 addition & 1 deletion src/react/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export interface QueryResult<TData = any, TVariables = OperationVariables>
error?: ApolloError;
loading: boolean;
networkStatus: NetworkStatus;
called: true;
called: boolean;
}

export interface QueryDataOptions<TData = any, TVariables = OperationVariables>
Expand Down

0 comments on commit 50ca93e

Please sign in to comment.