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
client.extract() seems not working with Reactive Variables #6713
Comments
I have same problem with Next.js, all changes doing in client side part, after hydration. I set value of reactive variable in cache in first component and try change value this reactive variable in second component, but value not changed. If change variable in current component I have reactivity. |
Yeah! I have the same problem. Something new about this? |
I have the same problem with Next.js. I use getServerSideProps for initialize apollo client store. But data for reactive vars reset on client. I get a hydration error with that data not the same. Hi, @benjamn! Can you help with it if it possible? UPD:
|
UPD: Found out that cache with reactive variables doesn't
extract()
from the apollo client during the SSR rendering. It is always empty object after extracting.Hello!
Thanks for your work on AC3. I am so excited to use its new API especially Reactive Variables.
I tried to implement it into my project that has SSR enabled.
The server renders fine and responds with the following cache object:
Then on the client, I am trying to populate my client cache object with the state from the server.
Also, I should create reactive variable with the following construction:
The problem is I must provide
initialValue
for the Reactive Variable and thatinitialValue
will overwrite the value that has come from the server. Basically if I docache.readQuery({...})
right after restoring the stateisLoggedIn
would be set totrue
until I use cache with reactive variables.I can still use
readQuery
andwriteQuery
in my project and everything will be fine, but Reactive Vars seem so easy to use and less boilerplate.The question is: is it possible to use reactive variables with the cache that is restored from server?
Thanks!
P.S. I am using the latest stable release of AC: 3.0.2. LMK I need to provide more info.
The text was updated successfully, but these errors were encountered: