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

Setting the debounce option makes the query fetch twice + ignores certain fetch policies #982

Open
cerino-ligutom opened this issue May 18, 2020 · 0 comments

Comments

@cerino-ligutom
Copy link

@cerino-ligutom cerino-ligutom commented May 18, 2020

Describe the bug
Setting the debounce option makes the query fetch twice (2 network calls). Once for the initial fetch, then another after the debounce duration. Only happens with a fetchPolicy of cache-and-network or network-only. The debounce seems to be ignored when it's set to other fetch policies.

To Reproduce
Steps to reproduce the behavior:

  1. Use useQuery
  2. Set debounce option
  3. Observe network in dev tools

Expected behavior

  1. Should not trigger a 2nd fetch after the debounce duration on initial fetch.
  2. Should work on other fetch policies besides cache-and-network and network-only.
  3. Should react on variable changes regardless of fetch policies.

Versions
vue: 2.6.11
vue-apollo: 4.0.0-alpha.8
apollo-client: 2.6.8

Additional context
When the fetch policy is set to cache-and-network or network-only, it fetches twice as described. However, it works as expected after any variable changes afterwards on the mentioned fetch policies.

On other fetch policies, it seems to be ignored even after variables changes. Is this intended?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.