Pagination goes into infinite loop when querying empty lists
See original GitHub issueWhen requesting a paginated resource with no values the paginator goes into an infinite loop of requests to the spotify api.
To reproduce the bug I made this query on a user with no public playlists
{
user(id: "someid"){
playlists{
name
}
}
}
The api returns an empty list with total=0
, but the !!iterator.total
condition inside the shouldStopIterate
function causes and infinite loop of requests.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Infinite loop in PagingSource when response is empty using ...
My problem is that when the API response retrieve an empty list, instead of print nothing, it causes an infinite loop in my...
Read more >A guide to pagination, load more buttons, and infinite scroll
Here, we explain a few methods of setting up pagination, load more buttons, and infinite scroll to create more dynamic web pages.
Read more >Infinite loop in pagination (API) - Microsoft Power BI Community
So I have a loop for my API to iterate over as many pages that are available (in this case around 13 loops...
Read more >Infinite Queries | TanStack Query Docs
When an infinite query becomes stale and needs to be refetched, each group is fetched sequentially , starting from the first one. This...
Read more >Pagination in Power Query (Part 2) – JenKuntz.ca
The specific nuance here is ClickUp returns a list every time, it does not return null when you hit a page with no...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @Skogsfrae,
Thanks for pointing this! 💯🙇
Please free to make a PR on this repo so I can review & publish it to
npm
🚢Will take a look in
spotify-graphql@4.0.0
, cf: #79