RefetchQueries not executed using BatchHttpLink with Apollo Client 3.6.x
See original GitHub issueHi Folks 👋,
We’ve run into an issue where refetch queries are no longer executed when upgrading to react 3.6.x.
It seems like this is caused by combining BatchHttpLink with Apollo Client 3.6.x. If we configure the BatchHttpLink with batchMax: 1
the issue goes away.
Please note that this could be similar to https://github.com/apollographql/apollo-client/issues/9690 but I wasn’t sure.
Thanks for all the hard work on Apollo Client 🙏
Intended outcome: Refetch queries get executed.
Actual outcome: Refetch queries are not executed
How to reproduce the issue: I was able to reproduce this issue in a test case using msw.
This is regular CRA project so running npm install
and npm test
should do the trick.
I have two branches, one with passing tests and one with failing tests where the client is upgraded to 3.6.x:
Passing test using Apollo Client 3.5.10 => https://github.com/skrivle/apollo-refetch-repro/tree/master Failing test using Apollo Client 3.6.x => https://github.com/skrivle/apollo-refetch-repro/tree/apollo-3.6.x (passes with batchMax set to 1)
Versions
This started happening as of version 3.6.0
System:
OS: macOS 11.6.5
Binaries:
Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.2/bin/yarn
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
Browsers:
Chrome: 101.0.4951.64
Firefox: 100.0.2
Safari: 15.5
npmPackages:
@apollo/client: 3.6.0 => 3.6.0
Issue Analytics
- State:
- Created a year ago
- Reactions:9
- Comments:6 (3 by maintainers)
Top GitHub Comments
I can confirm that this happens for us as well as soon as we update to
3.6.x
also with theBatchHttpLink
enabled.This should be fixed if you run
npm i @apollo/client@latest
to get version 3.6.7 (or later). 🎉