Function in onCompleted fires when skip is true
See original GitHub issueHi all, I’m experiencing the same issue as reported here by @xiaoyu-tamu: https://github.com/apollographql/react-apollo/issues/3814
I believe it was reported in the wrong place (under the old react-apollo repo), so I am reposting here for visibility.
Intended outcome:
Function specified in onCompleted
should not fire when the skip
option is true.
Actual outcome:
Function specified in onCompleted fires even when skip
option is true
How to reproduce the issue: @xiaoyu-tamu’s minimal codesandbox https://codesandbox.io/s/jolly-mclean-rtrwj
const { loading, data } = useQuery(ALL_PEOPLE, {
skip: true,
onCompleted: () => {
alert("skipped but onComplete fired");
}
});
Versions 3.0.0-beta.24 (codesandbox minimal reproduction) 3.0.0-beta.43 (reproduced in my own project)
System: OS: macOS 10.15.3 Binaries: Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node Yarn: 1.22.4 - ~/Desktop/{redacted}/node_modules/.bin/yarn npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm Browsers: Chrome: 80.0.3987.163 Firefox: 74.0 Safari: 13.0.5 npmPackages: @apollo/client: ^3.0.0-beta.43 => 3.0.0-beta.43 apollo-link-error: ^1.1.12 => 1.1.12 apollo-link-token-refresh: ^0.2.7 => 0.2.7
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:6 (2 by maintainers)
Top GitHub Comments
This has been fixed in https://github.com/apollographql/apollo-client/pull/6589 but we’re in a code freeze as we prep for the 3.0 launch tomorrow, so this fix won’t make it into 3.0. We’ll have it out in 3.0.1 right after the 3.0 launch. Thanks all!
The fix for this is now out in
@apollo/client@3.0.1
. Thanks!