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

[3.0] Eviction of fields by specific arguments #6141

Merged

Conversation

danReynolds
Copy link
Contributor

@danReynolds danReynolds commented Apr 12, 2020

Implementation of eviction by arguments API discussed here: #6098.

Evicts entities in the cache with exact matches of field names and arguments.

@apollo-cla
Copy link

@danReynolds: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@danReynolds danReynolds changed the title add support for eviction of field names by variables [3.0] add support for eviction of field names by variables Apr 12, 2020
@danReynolds danReynolds changed the title [3.0] add support for eviction of field names by variables [3.0] Eviction of field names by variables Apr 12, 2020
@danReynolds danReynolds force-pushed the feature/evictFieldWithVariables branch from c6b62e2 to 818cc82 Compare April 12, 2020 05:37
@codecov

This comment has been minimized.

@benjamn benjamn changed the title [3.0] Eviction of field names by variables [3.0] Eviction of fields by specific arguments Apr 15, 2020
@danReynolds danReynolds force-pushed the feature/evictFieldWithVariables branch 4 times, most recently from 0037460 to 28b139e Compare April 16, 2020 05:19
@benjamn benjamn added this to the Release 3.0 milestone Apr 17, 2020
@danReynolds danReynolds force-pushed the feature/evictFieldWithVariables branch from 572afc9 to eb79a07 Compare April 29, 2020 15:26
@danReynolds danReynolds force-pushed the feature/evictFieldWithVariables branch from e67d56e to f2a07d5 Compare April 29, 2020 15:31
@danReynolds danReynolds force-pushed the feature/evictFieldWithVariables branch 2 times, most recently from 575f532 to 1a91d05 Compare May 8, 2020 16:01
danReynolds and others added 2 commits May 8, 2020 19:42
When calling cache.evict, we do not have a FieldNode, so we cannot supply
variables to be combined with the field's arguments, but must instead
provide the fully-resolved arguments object.

To make this work, the context argument of KeyArgsFunction no longer
provides context.variables, since that information is not always
available. The arguments passed as the first argument to the
KeyArgsFunction should be sufficient to compute the field identity.
@benjamn benjamn force-pushed the feature/evictFieldWithVariables branch from 1a91d05 to edff808 Compare May 8, 2020 23:44
Copy link
Member

@benjamn benjamn left a comment

Choose a reason for hiding this comment

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

Approved with some tweaks to deal with args rather than variables (a subtle distinction, but important here IMO). Thanks for your patience @danReynolds!

@benjamn benjamn merged commit 3cf5d2a into apollographql:master May 8, 2020
@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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants