Skip to content

Commit

Permalink
Add default implementation of ApolloCache#gc (#5974)
Browse files Browse the repository at this point in the history
* Add default implementation of ApolloCache#gc

Addresses #5966

* Changelog update

Co-authored-by: Hugh Willson <hugh@octonary.com>
  • Loading branch information
justinwaite and hwillson authored Feb 21, 2020
1 parent 71c816a commit d42c280
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@
- Expose cache `modify` and `identify` to the mutate `update` function. <br/>
[@hwillson](https://github.com/hwillson) in [#5956](https://github.com/apollographql/apollo-client/pull/5956)

- Add a default `gc` implementation to `ApolloCache`. <br/>
[@justinwaite](https://github.com/justinwaite) in [#5974](https://github.com/apollographql/apollo-client/pull/5974)

### Bug Fixes

- `useMutation` adjustments to help avoid an infinite loop / too many renders issue, caused by unintentionally modifying the `useState` based mutation result directly. <br/>
Expand Down
4 changes: 4 additions & 0 deletions src/cache/core/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ export abstract class ApolloCache<TSerialized> implements DataProxy {
): boolean {
return false;
}

public gc(): string[] {
return [];
}

// Experimental API

Expand Down

0 comments on commit d42c280

Please sign in to comment.