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

Add skipBatch to cacheConfig options #100

Merged
merged 1 commit into from
May 17, 2020
Merged

Conversation

ekosz
Copy link
Contributor

@ekosz ekosz commented May 16, 2020

When cacheConfig.skipBatch is truthy, we skip batching for that request even when the batchMiddleware is present. This allows users to better control what requests are batched together.

Use case:

We have a bunch of QueryRenderers on the page at once. Some of those queries are very fast, but a couple of them are very slow. When they're all batched together those fast queries are now just as slow as the slowest query in the batch. This allows us to skip batching for those very fast queries so that user's get a snappier experience.

Fixes #80

This is my first PR on this project so please let me know what I may have missed or what I can do to further help!

When `cacheConfig.skipBatch` is truthy, we skip batching for that
request even when the batchMiddleware is present. This allows users to
better control what requests are batched together.
@nodkz nodkz merged commit 0a678f6 into relay-tools:master May 17, 2020
@nodkz
Copy link
Collaborator

nodkz commented May 17, 2020

Thanks 🙏

@nodkz
Copy link
Collaborator

nodkz commented May 17, 2020

🎉 This PR is included in version 4.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nodkz nodkz added the released label May 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

batchMiddleware - avoid batching certain query IDs
2 participants