Optionalconfig: CacheSyncerConfigTypeimport { InMemoryCache } from '@apollo/client'
import { setupCacheSyncer, stateSyncLink } from 'apollo-state-sync'
import { terminatingLink } from './util/terminatingLink'
// use setupCacheSyncer on inMemoryCache.
const inMemoryCache = setupCacheSyncer(
new InMemoryCache()
)
const apolloClient = new ApolloClient({
// use stateSyncLink. It is a non-terminating link.
ApolloLink.from([stateSyncLink, terminatingLink]),
cache: inMemoryCache,
})
Sets up synchronization and persistance of Apollo Client's in-memory cache.