Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's the problem this PR addresses?
I am trying to migrate from
apollo-link-state
, to fixdefault
state not being set onssr
.When this kit migrated to
apollo-client
3.0 (#1134),default
state was not set onssr
. Workaround for this was to set it in code and pass it to components manualy -> https://github.com/sysgears/apollo-universal-starter-kit/pull/1134/files#diff-1c960d0cc9e1d13dca0e9950e18e5f4eR25.Apollo docs, state that
apollo-link-state
is no longer needed and can be removed like this:https://www.apollographql.com/docs/react/v2.5/essentials/local-state/#migrating-from-apollo-link-state
It also states that
defaults
are no longer supported andcache.writeData
should be used to set it.How did you fix it?
I followed the migration guide and removed
withClientState
and calledcache.writeData
, to set default data, but it does not seem to work. Now even when code gets regenerated on client side, local state is not working.I
console.log
props.filter
on/users
route, to test this out.@larixer Could you please take a look what I am doing wrong and if you have any suggestions how to fix this?