apollo-client
apollo-client copied to clipboard
`relayStylePagination` returns duplicate results when the after variable is specified
Issue Description
I've encountered an issue when fetching data with useQuery, which uses the cache-and-network policy, from the second page by specifying the after variable. The first load works fine, but when I navigate to a different page and come back, useQuery returns duplicate results.
I also confirmed this issue can be fixed by https://github.com/apollographql/apollo-client/pull/9803. I hope this gets merged.
https://github.com/user-attachments/assets/e7ea9a7e-90e1-4af2-9d57-02e42559db2d
Link to Reproduction
https://github.com/ktmouk/apollo-client-pagination
Reproduction Steps
- Access http://localhost:3434/starwars
- Click "Home" link
- Click "/starwars" link
@apollo/client version
3.13.5
Related issues:
- #9802
Was this useful? Use the reactions below to give feedback.