Migrating from redux to apollo
Submitted by Kiran Abburi (@kiranabburi) on Monday, 29 January 2018
Technical level: Intermediate
In this talk, I will share our experience with migrating a large app from redux to apollo. Initially, we used redux to manage the state of react application. As the app grew in size, we were writing lots of custom logic for network use cases like data fetching, real time updates and error handling. We implemented abstractions to reduce verbosity of network logic. But, onboarding new developers and adding new features was hard because of the home-grown abstractions. We found GraphQL and Apollo in our exploration to simplify the network logic.
GraphQL and Apollo helped us a lot in simplifying network logic on both back-end and front-end code.
After migrating the network data from redux to apollo, only a small amount of local state is remaining in redux store. Apollo 2.0 supports local state management as well. So we migrated local state also to apollo and completely removed dependency on redux in our codebase.
- Challenges of redux and complex network logic
- How GraphQL and Apollo can simplify network logic
- Methodology for incremental migration of app from redux to apollo
- Local state management with apollo
Basic understanding of React and Redux
Kiran Abburi is a freelance developer with 6+ years of experience in web development. He primarily works on reactjs, nodejs and GraphQL projects. He is also an organizer of the Reactjs Bangalore meetup group.