Add persistor options in ApolloOfflineClient constructor
See original GitHub issueFeature Request
Is your feature request related to a problem? Please describe.
I’m using v0.11.0. It is not possible to specify persistor options in the ApolloOfflineClient constructor. When using with react native, it is necessary to use a ‘wrapper’ to force serialization of data saved in AsyncStorage since the default options passed to the persistor has the serialize option value as false which causes a problem when persisting the cache data.
Describe the solution you’d like Instead of having to define a ‘wrapper’ which is just a workaround, not a solution. Allow to define optional persistor options through the ApolloOfflineClient constructor. This will even solve #273
Describe alternatives you’ve considered None.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (4 by maintainers)
Top Results From Across the Web
class ApolloClient - Apollo GraphQL Docs
It backs all available view-layer integrations (React, iOS, and so on). The ApolloClient constructor. constructor(options). (src/core/ApolloClient.ts, line 127).
Read more >redux-persist - npm
Basic usage involves adding persistReducer and persistStore to your setup. IMPORTANT Every app needs to decide how many levels of state they ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@JaEdmuva we’ll definitely work on allowing you to pass down the persistor options through the constructor. In the meantime did you try following the steps for passing in a custom storage mechanism in our react native document? This storage mechanism might help you get past the error you are seeing. See https://offix.dev/docs/react-native#integration
I’m going to close this issue now, but please do not hesitate to reach out again with any more questions or feedback.