-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Allow silencing broadcast for cache update methods. #6288
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@hwillson Happy to split the |
@benjamn Keeping everything here together works for me, thanks! |
I'm all in for named options. Also, since it's a new major release anyway, I'm also for deprecating the old syntax with positional parameters. |
benjamn
force-pushed
the
make-readField-and-evict-accept-options
branch
2 times, most recently
from
May 18, 2020 14:52
da198a9
to
2d1c120
Compare
benjamn
changed the base branch from
set-context.keyObject-in-defaultDataIdFromObject
to
master
May 18, 2020 14:52
benjamn
added a commit
that referenced
this pull request
May 18, 2020
I decided to split these changes out from PR #6288 after all, per my comment #6288 (comment).
benjamn
added a commit
that referenced
this pull request
May 18, 2020
I decided to split these changes out from PR #6288 after all, per my comment #6288 (comment).
benjamn
force-pushed
the
make-readField-and-evict-accept-options
branch
from
May 18, 2020 21:39
2d1c120
to
ef6df37
Compare
benjamn
force-pushed
the
make-readField-and-evict-accept-options
branch
from
May 18, 2020 22:09
ef6df37
to
4699f5c
Compare
This was referenced May 26, 2020
47 tasks
18 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in #6262 (comment), it would be convenient to be able to silence the broadcast of cache updates for methods like
cache.writeQuery
,cache.writeFragment
, andcache.evict
.While this was an easy change for
writeQuery
andwriteFragment
, which already accept various named options (seeCache.Write{Query,Fragment}Options
), it was a bit trickier in the case ofcache.evict
, which instead has positional parameters:id: string
,fieldName?: string
, andargs?: Record<string, any>
(see #6141 ifargs
is new to you).Compared to named options, the ergonomics of positional parameters deteriorate rapidly as you add more parameters. Instead of continuing to fight that battle, I decided it was time to make
cache.evict
accept named options:Cache.EvictOptions
. Passingid
,fieldName
, andargs
arguments still works as a backwards compatible alternative toCache.EvictOptions
, but we won't be adding any new positional parameters tocache.evict
from this point forward. Any/all newcache.evict
inputs (such asoptions.broadcast
) will be added viaCache.EvictOptions
.