It doesn't appear here:
https://github.com/apollographql/apollo-client/blob/master/docs/source/api/apollo-client.md
https://www.apollographql.com/docs/react/api/apollo-client.html
Can you provide more information on what the issue is?
If the case is how to use client.writeData.
<apolloConsumer>
{client => client.writeData({ _object in store you want to modified_ })}
</apolloConsumer>
For more information here is the link of the documentation.
This feature is from react-apollo: react-apollo
The issue is that writeData
is mentioned in the client and cache API, is available for public use, but there are little docs on how to use it.
Also there's a few quirks about it, you can't just do client.writeData({ _object in store you want to modified_ })
, because of https://github.com/apollographql/apollo-link-state/issues/242#issuecomment-488066433 , https://github.com/apollographql/apollo-client/issues/4785#issuecomment-493061107 , https://github.com/apollographql/apollo-client/issues/4554 .
Also there's this id
param that probably should be constructed with client.cache['config'].dataIdFromObject
(another quirk here: config
is currently private property, thus it's difficult to reach dataIdFromObject
) .
I've followed the documentation and it just simply does not work. The cache is empty. It took me 3 days and I still can not make the local state works.
This function is gone as of 3.0.0
:
https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md#apollo-client-300
Most helpful comment
I've followed the documentation and it just simply does not work. The cache is empty. It took me 3 days and I still can not make the local state works.