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

Mutate update function DataProxy/ApolloCache changes #5956

Merged
merged 1 commit into from
Feb 18, 2020

Commits on Feb 18, 2020

  1. Mutate update function DataProxy/ApolloCache changes

    This commit gives the mutate `update` function direct
    access to the cache, instead of using a scaled down
    `DataProxy`. While the `DataProxy` approach helped in the
    past as a way to batch cache updates, it is no longer
    necessary. We are only ever passing a cache instance into
    `update`, which means limiting the type to be a `DataProxy`
    gives us no additional advantages. The only other `DataProxy`
    implementor in the AC codebase is `ApolloClient`, which
    is never passed to the `update` function.
    
    This commit also exposes optional `identify` and `modify`
    API elements in `ApolloCache`. Since `update` now has
    access to the full `ApolloCache` instance passed in,
    `identify` and `modify` can be used in the update function.
    Note that the `ApolloCache` implementations of `identify`
    and `modify` do nothing of value; they should be overridden
    by `ApolloCache` subclasses that are interested in using them,
    like `InMemoryCache` does. By including them in `ApolloCache`
    as basically no-op methods, we're avoiding forcing
    alternative cache implementations that subclass `ApolloCache`
    to have to support them.
    hwillson committed Feb 18, 2020
    Configuration menu
    Copy the full SHA
    be73571 View commit details
    Browse the repository at this point in the history