apollo-client icon indicating copy to clipboard operation
apollo-client copied to clipboard

`relayStylePagination` returns duplicate results when the after variable is specified

Open ktmouk opened this issue 1 year ago • 1 comments

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

  1. Access http://localhost:3434/starwars
  2. Click "Home" link
  3. Click "/starwars" link

@apollo/client version

3.13.5

ktmouk avatar Mar 26 '25 09:03 ktmouk

Related issues:

  • #9802

Was this useful? Use the reactions below to give feedback.

triagster[bot] avatar Mar 26 '25 09:03 triagster[bot]