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

AC3: Behavior differences between ApolloClient.write* and ApolloCache.write* (Seen in Apollo Client Dev Tools) #6331

Closed
jamshally opened this issue May 22, 2020 · 1 comment
Assignees
Milestone

Comments

@jamshally
Copy link

jamshally commented May 22, 2020

Context
When viewing cache items using Apollo Client Dev Tools:

  • ApolloClient.writeFragment updates are immediately reflected in Apollo Client Dev Tools
  • ApolloCache.writeFragment updates are not immediately reflected in Apollo Client Dev Tools

Intended outcome:

  • Primarily: for ApolloCache.write* and the ApolloClient.write* to behave the same (or to understand when/why they don't)
  • Ideally: for ApolloCache.write updates to be reflected in Apollo Client Dev Tools

How to reproduce the issue:
A recreation of the described behavior can be seen in this react-apollo-error-template

ApolloDevToolsIssueB

Notes
This is less about the Apollo Chrome Dev Tools, and more about having confidence in the cache update mechanism, and knowing how to use it. That being said, it would be nice if the Cache.write* method updates were visible in the Dev Tooling

Versions
System:
OS: macOS 10.15.4
Binaries:
Node: 13.7.0 - /usr/local/bin/node
Yarn: 1.22.4 - ~/.yarn/bin/yarn
npm: 6.13.6 - /usr/local/bin/npm
Browsers:
Chrome: 83.0.4103.61
Safari: 13.1
npmPackages:
@apollo/client: 3.0.0-beta.50 => 3.0.0-beta.50

@hwillson hwillson added this to the Release 3.0 milestone May 26, 2020
@benjamn
Copy link
Member

benjamn commented Jul 10, 2020

Thanks for surfacing this issue. In AC3, both client and cache update methods will broadcast by default, but the cache APIs all support silencing the broadcast if that's the preferred behavior: #6288. Although that's not exactly the same as the old behavior, hopefully it addresses your needs?

Closing since this change was intentional, but happy to continue the discussion.

@benjamn benjamn closed this as completed Jul 10, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 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

No branches or pull requests

3 participants