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

How Apollo store cache exactly works? #4023

Closed
mxrguspxrt opened this issue Oct 18, 2018 · 1 comment
Closed

How Apollo store cache exactly works? #4023

mxrguspxrt opened this issue Oct 18, 2018 · 1 comment
Labels
🚧 in-triage Issue currently being triaged

Comments

@mxrguspxrt
Copy link

mxrguspxrt commented Oct 18, 2018

We have query

  userData {
    id
    profileData {
      id
      name
    }
    moneyData {
      id
      currency
      amount
    }
  }

If profileData is loaded by component1 and moneyData is loaded by component2 with following queries:

First component1 loads:

  userData {
    id
    profileData {
      id
      name
    }
  }

Then a second component2 loads:

  userData {
    id
    moneyData {
      id
      currency
      amount
    }
  }

Expected result

Both components have their data.

Real result

profileData for component1 will be null.

Is this normal behaviour? What I am doing wrong?

@hwillson hwillson added the 🚧 in-triage Issue currently being triaged label Jul 9, 2019
@hwillson
Copy link
Member

hwillson commented Jul 9, 2019

Yes this is normal behavior, but it's definitely unfortunate. apollo-client 2.6.0 helps address this with the help of the returnPartialData option, and PR #4743 helps explain the issue (and fix). We'll be revisiting this in a future (breaking) version of Apollo Client.

@hwillson hwillson closed this as completed Jul 9, 2019
@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
🚧 in-triage Issue currently being triaged
Projects
None yet
Development

No branches or pull requests

2 participants