# Greetings everyone i am having trouble with the useInfiniteQuery function, the errors says No overload matches this call, please help me out

**URL:** <https://forum.codewithmosh.com/t/greetings-everyone-i-am-having-trouble-with-the-useinfinitequery-function-the-errors-says-no-overload-matches-this-call-please-help-me-out/24216>\
**Category:** React\
**Created:** [December 22, 2023, 7:21am UTC](https://forum.codewithmosh.com/t/greetings-everyone-i-am-having-trouble-with-the-useinfinitequery-function-the-errors-says-no-overload-matches-this-call-please-help-me-out/24216 "2023-12-22T07:21:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eden](https://avatars.discourse-cdn.com/v4/letter/e/5f9b8f/32.png) [@Eden](https://forum.codewithmosh.com/u/Eden)\
**Post date:** [December 22, 2023, 7:21am UTC](https://forum.codewithmosh.com/t/greetings-everyone-i-am-having-trouble-with-the-useinfinitequery-function-the-errors-says-no-overload-matches-this-call-please-help-me-out/24216/1 "2023-12-22T07:21:51Z")

</div>

![Screenshot (2)](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/8/83d7d8e417afee9e4ee229e9af9f23f5d6e6c7e8.png)

---

<div class="post-metadata">

**Author:** ![mahadshbeeb](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mahadshbeeb](https://forum.codewithmosh.com/u/mahadshbeeb)\
**Post date:** [December 30, 2023, 1:52pm UTC](https://forum.codewithmosh.com/t/greetings-everyone-i-am-having-trouble-with-the-useinfinitequery-function-the-errors-says-no-overload-matches-this-call-please-help-me-out/24216/2 "2023-12-30T13:52:53Z")

</div>

i get rid of the whole error by adding a curly bracise after the arrow function of the queryFn but the i got a new error in the queryFn itselft please if you found any solutions tell me

---

<div class="post-metadata">

**Author:** ![touhid](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@touhid](https://forum.codewithmosh.com/u/touhid)\
**Post date:** [January 14, 2024, 3:01am UTC](https://forum.codewithmosh.com/t/greetings-everyone-i-am-having-trouble-with-the-useinfinitequery-function-the-errors-says-no-overload-matches-this-call-please-help-me-out/24216/3 "2024-01-14T03:01:45Z")

</div>

Same problem in the same file and still have not found any solution. If you guys solve this issue then please tell me how do you resolve that?

---

<div class="post-metadata">

**Author:** ![sayedhfatimi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/sayedhfatimi/32/7724_2.png) [@sayedhfatimi](https://forum.codewithmosh.com/u/sayedhfatimi)\
**Post date:** [February 6, 2024, 11:28am UTC](https://forum.codewithmosh.com/t/greetings-everyone-i-am-having-trouble-with-the-useinfinitequery-function-the-errors-says-no-overload-matches-this-call-please-help-me-out/24216/4 "2024-02-06T11:28:44Z")

</div>

i had the same issue, wouldnt build on vercel, turns out the parameter `initialPageParam` is a requirement for the function `useInfiniteQuery`

```auto
const useGames = (gameQuery: GameQuery) =>
  useInfiniteQuery<FetchResponse<Game>, Error>({
    queryKey: ["games", gameQuery],
    queryFn: ({ pageParam = 1 }) =>
      apiClient.getAll({
        params: {
          genres: gameQuery.genreId,
          parent_platforms: gameQuery.platformId,
          ordering: gameQuery.sortOrder,
          search: gameQuery.searchText,
          page: pageParam,
        },
      }),
    getNextPageParam: (lastPage, allPages) => {
      return lastPage.next ? allPages.length + 1 : undefined;
    },
    initialPageParam: 1, //THIS LINE HERE!
    staleTime: 24 * 60 * 60 * 1000, //24h
  });

```

set the parameter to 1 like above and poof all bugs gone
