You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having a really hard time trying to understand how to restore data properly.
I managed to restore simple data (when key is a string) by overwriting the initial state. So before client.writeData(myInitialState) I replace values with those from the localStorage.
However, it doesn't work for arrays which are somehow modified when saving to the apollo cache.
For example, an initial state like this:
{agents: []}
is transformed (normalized?) to this:
{agents: {type: "json",json: []}}
When I set an initial state with the above, transformed version, my mutation doesn't work.
The text was updated successfully, but these errors were encountered:
I'm having a really hard time trying to understand how to restore data properly.
I managed to restore simple data (when key is a string) by overwriting the initial state. So before
client.writeData(myInitialState)
I replace values with those from the localStorage.However, it doesn't work for arrays which are somehow modified when saving to the apollo cache.
For example, an initial state like this:
is transformed (normalized?) to this:
When I set an initial state with the above, transformed version, my mutation doesn't work.
The text was updated successfully, but these errors were encountered: