[2.0] ApolloClient.reducer() method is gone, how to connect to redux?
See original GitHub issueIntended outcome: Create a new Apollo client, then plug it into redux as a reducer per these instructions.
Actual outcome:
Error: apolloClient.reducer is not a function
.
How to reproduce the issue: I tried to do this using both code-sandbox and react-apollo-error-template but neither has been updated for 2.0 and neither would work with the beta code. Here’s what I’m trying to do:
import ApolloClient from 'apollo-client';
import { HttpLink } from 'apollo-link-http';
import { combineReducers, createStore } from 'redux';
const httpLink = new HttpLink({ uri: 'https://some.data.url/' });
const apolloClient = new ApolloClient({ link: httpLink });
const store = createStore(
combineReducers(
{
apollo: apolloClient.reducer(),
someOtherReducer,
...
}
));
Version
- apollo-client@2.0.0-beta.4
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:44 (14 by maintainers)
Top Results From Across the Web
Reducing our Redux code with React Apollo
I'm a firm believer that the best code is no code. More code often leads to more bugs and more time spent maintaining...
Read more >ApolloClient reducer is not a function - Stack Overflow
I am using apolloClient to send requests to a graphql Server. However since my application use Redux I followed this document apollo-redux to...
Read more >Integrating Apollo GraphQL Client into a Redux application for ...
The withApollo() enhancer provides direct access to the Apollo Client instance, meaning you can perform custom queries from within the component ...
Read more >Integrating Microsoft Login and MSAL with React and Redux
The purpose of the reducer is to create a new version of the ... I can use the store.dispatch() method to dispatch each...
Read more >Manage React state without redux - ITNEXT
How to use React Context API in an easier and prettier way. ... connect: The connect() function connects a React component to a...
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 FreeTop 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
Top GitHub Comments
@lrettig you don’t need to anymore! Any reason you want to?
cache implementation abstraction is good, but not having redux implementation out of the box is bad, because right now I’m using redux for time travel, epics and I don’t want to just drop it and replace with graphql client, because building chains with epics is really cool stuff. So I will not be able to move on 2.0 until there will be redux package for Apollo client 2.0. so will be other developers who use redux.
P.S. Great features in 2.0 but redux support (via middleware) is must have I think