I’m a firm believer that the best code is no code. More code often leads to more bugs and more time spent maintaining it. At Major League Soccer, we’re a very small team, so we take this principle to heart. We try to optimize where we can, either through maximizing code reuse or lightening our maintenance burden.

In this article, you’ll learn how we offloaded data fetching management to Apollo, which allowed us to delete nearly 5,000 lines of code. Not only is our application a lot slimmer since switching to Apollo, it’s also more declarative since our components only request the data that they need.

What do I mean by declarative and why is that a good thing? Declarative programming focuses on the end goal, while imperative programming focuses on the steps it took to get there. React itself is declarative.

#redux

Reducing our Redux Code with React Apollo
1.40 GEEK