Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Fetch All Pages Simultaneously with useInfiniteQuery #6253

Closed
amjadbouhouch opened this issue Oct 26, 2023 · 1 comment
Closed

Comments

@amjadbouhouch
Copy link

Describe the bug

I am trying to fetch all pages simultaneously using useInfiniteQuery because I know the total pages in advance, but it doesn't work as expected.

In the Network Tab all the requests are fired as I expected. But The data from useInfiniteQuery contains only two pages the first page & the last page.

Your minimal, reproducible example

https://codesandbox.io/s/unable-to-fetch-all-pages-simultaneously-with-useinfinitequery-n74mw4?file=/src/App.js

Steps to reproduce

  1. Open the ReactQueryDevtools
  2. Open Data Explorer

Expected behavior

As a user, I expected to fetch multiple pages simultaneously using useInfiniteQuery by calling fetchNextPage({pageParam})

How often does this bug happen?

Every time

Screenshots or Videos

Screenshot from 2023-10-26 16-28-10
Screenshot from 2023-10-26 16-28-45

Platform

  • Browser: Chrome

Tanstack Query adapter

react-query

TanStack Query version

4.36.1

TypeScript version

No response

Additional context

No response

@amjadbouhouch
Copy link
Author

Closing #5583

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant