aerogear / offix

GraphQL Offline Client and Server
https://offix.dev
Apache License 2.0
758 stars 45 forks source link

apollo.getClient().resetStore() does not reset cache #679

Closed cjohn001 closed 3 years ago

cjohn001 commented 4 years ago

Hello together, I am not sure if this is an intended behavior or a bug. I need to reset my cache in certain situtations (different user logs in, timezone changes...) I tried to call apollo.getClient().resetStore() to empty the cache. It seems like the local storage is not written when calling resetStore. I observed that normally an each cache change the data are written da local storage. So is the behavior intended. How would I than have to clear the persistent storage? Using a custom cache persistor and using persist() after calling resetStore()? Thanks for your help

wtrocki commented 4 years ago

See: https://github.com/apollographql/apollo-cache-persist/issues/126

wtrocki commented 4 years ago

PS: We doing major rewrite of offix (I think you would like it :)

cjohn001 commented 4 years ago

Hello @wtrocki. Ok, this works. Thanks for the link. A question regarding the rewrite as I have not found an official roadmap for offix yet. Will the rewrite be due to apollo 3 integration? Please let me know once a certain stability is reached. I will than integrate it with offix-angular. Currently, I the offline features are not in use with offix-angular and I think it might make more sense for me to wait with it in case the offix rewrite comes in the near future. I assume there will be changes in the interfaces of the library? Thx for letting me know.

wtrocki commented 4 years ago

We keep apollo2.0 compatibility so no changes should be needed

kingsleyzissou commented 3 years ago

Hi @cjohn001, I won't ping you in any more of these issues, since I think you've got a few of them still up. But feel free to message us if you have any further questions. In the meantime I am going to close the other issues up for the older Offix packages