Introduction to Relay Modern

Introduction to Relay Modern

Relay Modern is a new version of Relay designed from the ground up to be easier to use, more extensible and, most of all, able to improve performance on mobile devices. Relay Modern accomplishes this with static queries and ahead-of-time code generation.

Getting Started

Upgrade to react-relay v1.0.0

Relay v1.0 introduces the Relay Modern API:

yarn add react-relay

When upgrading an existing Relay app, replace all require('react-relay') with require('react-relay/classic') to continue to import the Relay Classic API.

Set up babel-plugin-relay

Relay Modern requires a Babel plugin to convert GraphQL to runtime artifacts:

yarn add