@ads1018 the Apollo doc is a bit confusing (https://github.com/apollographql/react-docs/issues/123) but I think apollo shouldn't be hard-coded, instead should use something along the lines of:
const initialState = {
...state,
[client.reduxRootKey]: {
data: client.store.getState()[client.reduxRootKey].data
}
};
Or actually can be simplified to (https://github.com/apollographql/react-docs/pull/141/files#diff-e65085a675fc082c408f1708267d9b28R138):
const initialState = {
...state,
[client.reduxRootKey]: client.getInitialState(),
};
@sedubois Good spot. Makes sense to me. I'll make a pull request.
@sedubois The Apollo Client release candidate deprecated reduxRootKey so I changed the key back to apollo in the example. There might be repercussions that I'm not aware of by doing this though. If you know of a better way let me know.
Lets close this and re-open if there are any issues with that @ads1018
Okay, thankfully Apollo should be stabilizing now 馃槃 I'll update my app when I find some time and report any findings