Skip to content
New issue

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

Function in onCompleted fires when skip is true #6122

Closed
ardiewen opened this issue Apr 8, 2020 · 6 comments · Fixed by #6589
Closed

Function in onCompleted fires when skip is true #6122

ardiewen opened this issue Apr 8, 2020 · 6 comments · Fixed by #6589

Comments

@ardiewen
Copy link

ardiewen commented Apr 8, 2020

Hi all, I'm experiencing the same issue as reported here by @xiaoyu-tamu:
apollographql/react-apollo#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

@3nvi
Copy link

3nvi commented Apr 10, 2020

Yeah, can verify it's still happening on 3.0.0-beta.31

@noglitchyo
Copy link

noglitchyo commented Apr 16, 2020

Hi, I am also experiencing this issue.

Versions
apollo-client: 2.6.8
@apollo/react-hooks: 3.1.5

@martinschmelzer
Copy link

martinschmelzer commented Apr 20, 2020

Same here with @apollo/react-hooks 3.1.5

@hashinclude72
Copy link

It is still in @apollo/client 3.0.0-beta.44

@hwillson hwillson added this to the Release 3.0 milestone May 26, 2020
@hwillson hwillson self-assigned this May 26, 2020
hwillson added a commit that referenced this issue Jul 14, 2020
At some point this functionality was lost during refactoring.

Fixes #6122
hwillson added a commit that referenced this issue Jul 14, 2020
At some point this functionality was lost during refactoring.

Fixes #6122
@hwillson
Copy link
Member

This has been fixed in #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!

@hwillson
Copy link
Member

The fix for this is now out in @apollo/[email protected]. Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants