Comments (2)
Hey @ira-kaundal 👋
We talked about this as a team yesterday and think this is an idea eventually worth pursuing! One of the other maintainers has toyed with an idea similar to this, so we think a feature like this makes sense.
A few notes on from our meeting on how we envision this feature:
- We might consider calling this
drop
(similar to how Rust works) - We'd like this to work on the type level, which would run when a record is evicted from the cache via
cache.evict()
, or removed viacache.gc()
. - We'd like to think through whether a
drop
function makes sense at the field level since there are additional cases to consider. Would it run when updating a value because this would be considered "dropping" the old value? Would it run exclusively when the field is removed from the cache (e.g. returningDELETE
fromcache.modify()
), etc. These are some things to think about :)
These are just some preliminary ideas that evolve on your idea here which would need some additional design consideration, but again, definitely something that we think makes sense! We don't have a specific timeline we can guarantee yet since we are still planning out our next few versions.
Thanks for opening this request!
from apollo-feature-requests.
Hi @jerelmiller, just wanted to follow up on whether you have any thoughts on this proposal.
from apollo-feature-requests.
Related Issues (20)
- Default onError/onCompleted callback HOT 9
- Automatically infer `__typename` for local data
- Remove React dependency when importing gql from @apollo/client HOT 2
- Support `select` QueryHookOptions in `useQuery`
- @defer timeout in clients HOT 3
- Allow passing in a client object to the `useFragment` hook HOT 2
- Remove "React" from the docs and keep it generic HOT 1
- Support skipToken in useReadQuery HOT 6
- Add cache eviction of a query via query DocumentNode HOT 1
- Run a callback before the internal state of useMutation is updated.
- Local Resolvers: Support returning errors and data together for partial results
- Dependency Dashboard
- Revisit `refetchQueries` API
- Add an option to MockProvider to throw when a request fails to match a mock
- Please add polyfill for `globalThis` as it breaks compatibility for Chrome < v71 HOT 2
- Refetch on window focus HOT 3
- Drop `ApolloClient.query()` in next major HOT 1
- Keyword search in Job postings filter HOT 1
- warnAboutDataLoss fails with stringifying error and breaks application
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-feature-requests.