How GraphQL Replaces Redux

⚛️ Switching to React

↪️ Switching to GraphQL

🤯 Three Startling Realizations

  1. Most of our state management code was concerned with merging and mutating data from discrete REST resources into the right shape for our UI (reducers, selectors, actions etc.).
  2. A lot of our most complex state management was trying to manage the asynchronous nature of getting all that data in the right order for a specific route (sagas, middleware, thunks etc.).
  3. Practically everything else, UI state, worked great with plain old React state.

So about GraphQL and Redux…

Redux + REST left — Apollo + GraphQL right

--

--

--

Web designer, developer, and teacher. Working at the cross-section of learning and technology. Co-Founder, CTO of Pathwright. Launcher of side projects.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Handling complex JSON Schemas in Python

Data Handling in Modern ReactJS Environment

Fun with other Javascript Console methods

React Native: the good, the bad and the ugly

Basic Algorithm Scripting: Slice and Splice

Create Cookies in Cordova with Oreo.js

Improving Unit Test Coverage

Top 10 Github Apps on Marketplace to Use as Junior JavaScript Developers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mark Johnson

Mark Johnson

Web designer, developer, and teacher. Working at the cross-section of learning and technology. Co-Founder, CTO of Pathwright. Launcher of side projects.

More from Medium

Implement Analytics Dashboard in React using Custom Resolvers for MongoDB Realm GraphQL

Analytics Dashboard implement in React.js which is using data fetched from MongoDB Realm GraphQL

Routes management without any magic strings (Not just another constants file approach)

What is the significance of Suspense for React?

Creating and Testing Streamlined Components in ReactJS Using Hooks