# How to do Apollo client useLazyQuery

**URL:** <https://community.apollographql.com/t/how-to-do-apollo-client-uselazyquery/3648>\
**Category:** Client SDKs\
**Tags:** client, web\
**Created:** [June 2, 2022, 5:27pm UTC](https://community.apollographql.com/t/how-to-do-apollo-client-uselazyquery/3648 "2022-06-02T17:27:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![swimhiking](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/swimhiking/32/2456_2.png) [@swimhiking](https://community.apollographql.com/u/swimhiking)\
**Post date:** [June 2, 2022, 5:27pm UTC](https://community.apollographql.com/t/how-to-do-apollo-client-uselazyquery/3648/1 "2022-06-02T17:27:50Z")

</div>

I am struggling with unit tests for Apollo client useLazyQuery ; I tried use mocks, but always no data; any people can help me with this? thanks

Sheng

---

<div class="post-metadata">

**Author:** ![stazcp](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/stazcp/32/5033_2.png) [@stazcp](https://community.apollographql.com/u/stazcp)\
**Post date:** [April 19, 2024, 4:22pm UTC](https://community.apollographql.com/t/how-to-do-apollo-client-uselazyquery/3648/2 "2024-04-19T16:22:04Z")

</div>

same issue here can’t seem to find a satisfactory response, even ai is struggling

---

<div class="post-metadata">

**Author:** ![lenz](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/lenz/32/4007_2.png) [@lenz](https://community.apollographql.com/u/lenz)\
**Post date:** [April 22, 2024, 9:57am UTC](https://community.apollographql.com/t/how-to-do-apollo-client-uselazyquery/3648/3 "2024-04-22T09:57:38Z")

</div>

Have you taken a look at how Apollo Client tests `useLazyQuery`?

> <https://github.com/apollographql/apollo-client/blob/b0c4f3ad8198981a229b46dc430345a76e577e9c/src/react/hooks/ __tests__ /useLazyQuery.test.tsx>
