Closed krunaldodiya closed 4 years ago
Sadly there is no public api for that but it is very easy to do it.
Persistor is public so.. you can set new Persistor with custom options: https://github.com/aerogear/offix/blob/master/packages/offix-client/src/ApolloOfflineClient.ts#L52-L58
Swapping persistor needs to happen before calling init function as it is used there: https://github.com/aerogear/offix/blob/master/packages/offix-client/src/ApolloOfflineClient.ts#L73-L76
EDIT: Links above pointing to master version - 0.10.0 will have small differences in config sturcture
Thanks, I will try and let you know
@darahayes IMHO we might need to document this issue
@kunaldodiya we recently merged and released https://github.com/aerogear/offix/pull/306 (in version 0.13.1
) which allows you to create your own CachePersistor
object and pass it into the OfflineClient
constructor. This should let you set whatever options you require for cache persistence. You can check the PR description or the client configuration docs to learn how to do it. I'm going to close this issue now but please do reach out if you have any further questions/feedback/issues.
How to set apollo-cache-persist options like maxSize, debug, debounce, trigger in react native app ?