The New York Times — Now On Apollo

This post was originally published on this site


By JEREMY GAYED AND SCOTT TAYLOR

We wrote this summer about our move to React and GraphQL at The New York Times. At the time, we were using Relay, Facebook’s open source GraphQL client. We recently shipped a refactor of our app to production using another GraphQL client: Apollo.

Apollo is being used by our web frameworks team and by a number of our feature teams. It is changing the way we build the reading experience for our users, and it gives our developers more tools with which to create.

What about Relay?

Facebook rewrote Relay and released it this summer as Relay Modern. We took a deep look at it, which Scott Taylor wrote about here. And while Relay Modern is a good option for many teams, there are some important differences.

Most notably:

  • First-class support for server-side rendering
    Server-side rendering (SSR) is a hard requirement for our site. There are important SEO considerations, as well as performance benefits like First Meaningful Paint (FMP). Relay takes a “bring your own solution” approach to this problem. In Apollo, SSR is a first-class feature. This is huge for us.
  • Routing agnostic
    Relay Classic and Relay Modern do not ship with a router — you must bring your own. The open source community around Relay does not leave us with many options. Apollo is router-agnostic, which means we have choices and can pivot, if necessary.

Onto Apollo

While we were using Relay Classic, Jeremy Gayed took an early look at Apollo. In his post here, he explained that it was clear there were a number of long-standing issues Apollo could help us solve.

From an end-user perspective, there is little difference. However, from a development and product perspective, Apollo unlocks future platform improvements that we’re really excited about:

The Apollo team has been helpful and responsive throughout our migration, even publishing two package upgrades as a result of our direct feedback! We are grateful for their support and excited to build out new experiences for our readers.

Want to know more?

Watch Scott Taylor’s GraphQL Summit keynote.


The New York Times — Now On Apollo was originally published in Times Open on Medium, where people are continuing the conversation by highlighting and responding to this story.

Comments are closed.

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑