title: React-Query getstaticprops useInfiniteQuery
body: <p>Trying to fetch paginated data using useInfinitQuery from react-query package but no data fetched and displayed in react-query-devtools.</p>
  <p><strong>Page.tsx</strong></p>
  <pre><code>export async function getStaticProps(): Promise&lt;
    GetStaticPropsResult&lt;{ dehydratedState: DehydratedState }&gt;
  &gt; {
    await queryClient.prefetchInfiniteQuery(['randomVideos'], fetchRandomVideos);
  return {
      props: {
        dehydratedState: JSON.parse(JSON.stringify(dehydrate(queryClient)))
      },
      revalidate: 60 * 60
    };
  }
  </code></pre>
  <p><strong>Requests.ts</strong></p>
  <pre><code>export function fetchRandomVideos({ pageParam = 1 }) {
    return Request.get&lt;PaginatedResponseBody&lt;TRandomVideo&gt;&gt;(
      endpoints.RANDOM_VIDEOS,
      {
        params: {
          page: pageParam,
          per_page: 10
        }
      }
    );
  }
  
  export function useRandomVideosQuery() {
    return useInfiniteQuery(
      ['randomVideos'],
      ({ pageParam }) =&gt; fetchRandomVideos({ pageParam })(),
      {
        getNextPageParam: (lastPageData) =&gt; lastPageData?.data.next_page_url
      }
    );
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/iAU2l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iAU2l.png" alt="enter image description here" /></a></p>
  <p>What is the issue?</p>