Session description
Pinterest is adopting GraphQL. Given our app's size, we can't simply rewrite everything in one fell swoop. So, we created the Relay Migration API (RMA) — a set of tools to incrementally migrate your React components to consume GraphQL-shaped data while making requests to REST endpoints.
I'll share how we've significantly evolved the RMA after migrating four key surfaces, focusing on the advanced challenges we faced:
RMA recreates objects on every render by default, breaking components expecting stable references. We implemented a caching layer, similar to Relay's, to return consistent objects between renders. RMA originally read from static source objects, creating stale data when Redux state changed. Our solution: a selective subscription system that re-computes GraphQL data only when source fields change, keeping data current while eliminating unnecessary renders. And in cases where Redux and GraphQL schemas fundamentally differ, we built bidirectional mapping with schema validation to ensure data consistency.
Join us to learn how the Relay migration API has evolved and how it helps you accelerate your GraphQL migrations without disrupting existing applications!