Scott Taylor gave a talk about the New York Times' experience moving to GraphQL. Some key points:
1. The NYT previously took a long time to replatform and vowed to never take as long again, but their current project is also taking a long time.
2. They are moving their datacenter apps to Google Cloud Platform and migrating their data pipeline.
3. Their GraphQL server is written in Scala and maintained by a team called Samizdat, while their frontend uses Relay Classic with React and is maintained by the Web Frameworks team.
4. They have experienced challenges with schema evolution, versioning, and pivots with their GraphQL implementation.
3. Scott Taylor
• I live in Brooklyn, NY with my wife, Allie (+ cats)
• Sr. Software Engineer, Web Frameworks
The New York Times
• WordPress core team
• Musician
• @wonderboymusic on Twitter
• @staylor on GitHub
6. Goals
• Simplify our stack
• One place to add and retrieve data
• Common language / repository for creating / reusing
components
• Make onboarding easier
10. Our Last Replatform
• NYT5 - 4 short years ago
• “We are never taking this long on a project
ever again” - our CEO at the champagne
toast celebrating the above.
• (We are taking this long on the project
currently)
11. So WHY replatform?
• Consistency: Design changes should affect
as few codebases as possible
• Desktop and mobile apps will be one
• iPhone and iPad rewritten as one in Swift
• Android and iOS render WebViews
12. Technical Notes
• moving Datacenter apps to Google Cloud
Platform
• NYTimes/drone-gke
NYTimes/drone-gae
• Moving data pipeline to internal schema that
uses ProtoBufs / writes to Kafka
• KYT: manages configuration of Node
13. GraphQL at the NYT
• the GraphQL server is a Sangria app, written
in Scala, maintained by a data team called
Samizdat
• the frontend is a universal Relay (Classic)
app, running on Node/Express, maintained
by the Web Frameworks team
19. Pivots
• initially mirrored REST schema
• versioned the schema / generated from ProtoBufs
• versioned the schema again, driven by product
• after going all in on designing schema using NYT design
terminology, decided to remove some abstractions to
avoid fragment complexity
21. • v0.1.0 through 0.7.3 were all released (on GitHub)
on March 4, 2016
• v0.8.0 was April 2016
• v0.9.0 was May 2016
• v0.9.1 was June 2016
• v0.9.2 was July 2016
• v0.9.3 was September 2016
• v0.10.0 was December 2016
63. Structured Data
• Union types: BlockUnion and InlineUnion
• fragments and queries can become enormous when
using heterogenous types
• recursion of unknown/infinite depth is a problem in
GraphQL
64. Scripts in HTML
• JavaScript will not execute when simply:
<div dangerouslySetInnerHTML={{ __html: content }} />
• Scripts need to be parsed out of content and intialized/re-
initialized on: componentDidMount / componentDidUpdate
• Server-rendering scripts - nodes get blown away on
ReactDOM.{render,hydrate}
65.
66. Roadmap
• Moving to React 16, adjusting to the ecosystem
• Continue following developments with Relay/Apollo
• Continue evolving our schema
• CSS-in-JS (!!!), Emotion and friends