We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am using fetchMore to make pagination works.
typePolicies: { Query: { fields: { books: { read(existing, {args: {skip = 0}}) { //THIS ARGS IS ALWAYS THE INITIAL ARGS, NEVER IS UPDATED BY FETHMORE console.log('read skip', skip) return existing?.slice(skip, skip + 10); }, keyArgs: false, merge(existing, incoming, {args: {skip = 0}}) { //THIS IS UPDATED OK console.log('merge skip', skip) const merged = existing ? existing.slice(0) : []; for (let i = 0; i < incoming.length; ++i) { merged[skip + i] = incoming[i]; } return merged; }, } } } }
fetchMore({ variables:{skip: skip + 10} })
no matter what the passed to fetchMore, in read->args skip always is the initial value. while in merge->args is updated.
https://github.com/cesarve77/apollo3bug
git clone https://github.com/cesarve77/apollo3bug cd apollo3bug apollo3bug server npm i node index.js
cd apollo3bug apollo3bug browser npm i npm run start
click on next page, check the console, ('read skip', skip) should change any timt next page is clicked
@apollo/client
3.9.9
The text was updated successfully, but these errors were encountered:
Hey @cesarve77 👋
Thanks for the report! We'll do our best to take a look at this soon.
Sorry, something went wrong.
No branches or pull requests
Issue Description
I am using fetchMore to make pagination works.
no matter what the passed to fetchMore, in read->args skip always is the initial value. while in merge->args is updated.
Link to Reproduction
https://github.com/cesarve77/apollo3bug
Reproduction Steps
click on next page, check the console,
('read skip', skip) should change any timt next page is clicked
@apollo/client
version3.9.9
The text was updated successfully, but these errors were encountered: