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

support "debounce" for the batch link #8024

Merged
merged 3 commits into from
Apr 30, 2021

Conversation

dannycochran
Copy link
Contributor

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

Motivation:

By default, @apollo/client/link/batch-http throttles requests using batchInterval. E.g. the queue of batched requests will fire every batchInterval milliseconds.

It may be desirable to instead debounce those requests so every new inbound request resets the timer. For instance, many mutations which are firing frequently from editing a table.

This PR introduces a simple debounce boolean to the http-batch-link and batch-link.

Copy link
Contributor

@brainkim brainkim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@dannycochran
Copy link
Contributor Author

@brainkim thanks for the quick review, resolved your comments.

@brainkim
Copy link
Contributor

@benjamn @hwillson lgtm?

Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 from me - thanks very much @dannycochran!

@benjamn benjamn merged commit 7f37666 into apollographql:main Apr 30, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants