-
Notifications
You must be signed in to change notification settings - Fork 34
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
SSR with cache ? #21
Comments
That would be pretty easy if #13 happens. Then you can pull the state directly from the redux store. You won't have to use redux in the browser as you could have a split point based on if it was running server-side. |
There is method for that:
And it's working on server side for our simple cache provider. Example app for next.js framework (responses are cached for 10s on server side):
|
@marcin-piela I need a simple API like const cache = ...
const html = React.renderToString(<App />);
const serialized = serialize(cache.getState()); Currently, i'm using Apollo Client state. But it's limited to only graphql query. |
For now only |
@marcin-piela My use case is as in Redux use case. My expectation is an API like |
@revskill10 new version 1.2.0 supports your usecase Documentation: Codesandbox example:
//on server:
const cachedItems = client.cache.getItems()
//send to client:
client.cache.setItems(cachedItems) |
Is there any method from
cache
to return cache data to client ?The text was updated successfully, but these errors were encountered: