I have an React Native application that I am having difficulty with setting up and offline mode feature.
Mainly I am using apollo-link-offline and apollo3-cache-persist
( from my useApolloClient hook) :
await persistCache({
cache,
storage: new AsyncStorageWrapper(AsyncStorage),
.....
}).then(() => {
const httpLink = new createHttpLink({
uri: Config.MY_API_URI
... more links
const client = new ApolloClient({
...
link: ApolloLink.from([
apolloLogger,
authLink,
offlineLink,
httpLink
})
setClient(client)
offlineLink.setup(client)
});
What key steps are needed in order for mutation queuing, and the mutation calling immediately after returning online?
I am caching all queries and the cached data is displayed when offline as expected, but when returning online, mutations attempted are not queuing / firing.
I have added OptimisticResponses to the mutations as well.