-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Server rehydration cause first client query fail #759
Comments
Thanks for reporting. The solution is to only include the Can you try the fix of deleting every field except |
Thank you for the suggestion. That's exactly what I did yesterday, patchy solution though but it solves the problem.
UPDATE: navigating back to first page uses the local cache. Previously it wasn't the case on me because I For those experiencing the same problem, my solution is:
|
My app has main Redux store which Apollo attached to, with store rehydration and server side rendering.
When the page is first loaded (Server side rendering),
apollo/queries/0
has the following initial value (which seems valid):The query is as follow (
$page
= 1):Problem
When the same query is run again on client but with different $page variable (i.e. move to 2nd page),
apollo.query
returns prematurely afterAPOLLO_QUERY_INIT
but beforeAPOLLO_QUERY_STOP
andAPOLLO_QUERY_RESULT
. And the result printed fromconsole.log
above is wrong: the same as the one on the first page.Moreover I think it's weird that
APOLLO_QUERY_INIT
modifyapollo/queries/0/variables/page
from1
to2
(shouldn't it just append new queries:apollo/queries/1
instead of updating the existing one?).More insight
Without refreshing the page, the same query is run again with even different $page variable (i.e. move to 3rd page). Now it prints correct result. Subsequent query also works correctly
The text was updated successfully, but these errors were encountered: