Closed wtrocki closed 4 years ago
Hello, I would like to take this issue can you give me more details?
I'm the lead developer of @NovaHelm team, currently working on open source projects to gain experience for ourselves
We need to change package name in offix-client and offix-offline from apollo-cache-persist to apollo-cache-persist-dev
Very simple issue. Must have for 0.12.0
We might also check if it will be possible to use: https://morrys.github.io/wora/docs/cache-persist This package offers filtering capabilities and subscriptions
I've been thinking about this. We now allow users to pass in their own CachePersistor instance (one is created by default if not passed). See the docs here: https://offix.dev/docs/client-configuration#cachepersistor
Perhaps we could bundle our own CachePersistor in offix client and then if users want to pass their own instance, they will use the one we export from offix-client
. It could work something like this:
import {
ApolloOfflineClient,
CachePersistor,
createDefaultCacheStorage
} from "offix-client";
import { HttpLink } from "apollo-link-http";
import { InMemoryCache } from "apollo-cache-inmemory";
const cache = new InMemoryCache()
const cachePersistor = new CachePersistor({
cache,
storage: createDefaultCacheStorage()
})
const client = new ApolloOfflineClient({
cache,
cachePersistor,
link: new HttpLink({ uri: "http://example.com/graphql" });
});
What do you think?
Is this issue still relevant?
Good point. We actually thinking of bringing the Apollo-Cache-Perist code inside the repository so dev release is not longer needed.
Feature Request
Package name changed to apollo-cache-persist-dev. Offix-client package needs update in package.json