1. React
  2. ReactFoo
  3. 2018 Mumbai
  4. Migrating from redux to Apollo

Migrating from redux to Apollo

Kiran Abburi at ReactFoo 2018 Mumbai

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. Outline: - 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