-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Support for Apollo 3.0 beta #317
Comments
Apollo-Cache-Persist works quite nicely with the beta Apollo 3.0 after changing imports. CC @benjamn |
3.0 doesn't have defaults anymore, only the |
@dcecile Can you clarify this better. I would recommend to drop some separate issue if you have it running with 3.0 |
Hi @wtrocki- can you clarify which imports (related to this package) need to be updated? I'm in the process of updating to apollo 3.0 and having some trouble.
|
This information is outdated. In latest beta there is common package that should be used along with the cache interface. I have stopped looking into betas and waiting for some solid release to get things updated. |
3.0 released today, has anyone tried spinning this up? |
I'm trying to update, persist cache complains about the missing writeData API. Currently investigating whether this is fully breaking or not. |
I've checked writeApi is not used in apollo-cache-persist and proceeded to @ts-expect-error for now. No issues YET. |
Thanks, @Titozzz. Glad to hear you're having no issues. Has anyone else tried this with Apollo Client 3.x yet? I'm planning on migrating to 3.0 this week and wondered what I'm in for regarding this package. 😄 |
I'm using apollo-cache-persist since Apollo client Beta 35, no issues! 😄😄 |
Here is an example of how I am using apollo-cache-persist with @apollo/client 3.0.2 in my web app. import React from 'react';
import { useEffect, useState } from 'react';
import { ApolloProvider } from '@apollo/client';
import { persistCache } from 'apollo-cache-persist';
//import a configured ApolloClient and InMemoryCache object
import client, { cache } from './client';
export default function ApolloProviderPersisted(props) {
const [isPersisted, setIsPersisted] = useState();
useEffect(() => {
async function hydrate() {
await persistCache({
cache,
storage: window.localStorage
});
setIsPersisted(true);
}
hydrate();
}, []);
if (!isPersisted) {
//persistGate prop is a React component that displays a loading placeholder
return props.persistGate || null;
}
return <ApolloProvider client={client}>{props.children}</ApolloProvider>
}; |
There are typescript problems due to changes in imports.
patch-package fix
|
Support landed in master. Working on releasing this |
As in topic new Apollo client exists as a single package with embedded cache
The text was updated successfully, but these errors were encountered: