Sunday, October 25, 2026 4,350 lists 78,100 records on file
List your app or device

  1. Home
  2. GraphQL Tools
  3. Relay

Relay

What it is

Relay is a free GraphQL client for React that combines components’ data requirements into optimized queries that can be prepared in advance. Components declare what data they need, and Relay consolidates those needs, including duplicate fields. Its normalized data store keeps components that observe the same data in sync. For interface behavior, it supports loading states, pagination, refetching, optimistic updates, and reverting updates when mutations fail. Queries can defer some data so the interface renders progressively as more arrives. Relay generates TypeScript types for GraphQL snippets and provides editor support such as schema completion and go-to-definition. Developers can configure its network layer for HTTP, WebSockets, authentication, caching, telemetry, and form-data uploads. Relay requires GraphQL, a Babel plugin, and the Relay Compiler; production guidance recommends running the compiler in CI and keeping generated artifacts in source control. Documentation covers setup with React, Vite, TypeScript, and Babel, as well as React Native. Relay recommends persisted queries to restrict clients to queries fixed at build time.

For and against

For

  • Combines component data needs into optimized queries.
  • Keeps shared observed data synchronized.
  • Supports optimistic updates and rollbacks.
  • Generates TypeScript types for GraphQL snippets.

Against

  • Requires GraphQL.
  • Requires a Babel plugin and Relay Compiler.
  • Production guidance calls for CI compiler runs and source-controlled artifacts.

The verdict

Relay pairs data fetching with interface patterns and generated types for React applications using GraphQL. Its compiler and build requirements are important considerations for teams evaluating the setup.

Who it suits

Relay is for React developers building GraphQL-powered interfaces who want generated types and coordinated component data. It is a fit for teams prepared to use GraphQL, Babel, and the Relay Compiler.

On the record

Built-in UI patterns
Relay supports loading states, pagination, refetching, optimistic updates, and rollbacks.relay.dev · read 2 Oct 2026
Company and project
The site identifies Meta Platforms, Inc. in its copyright notice and says Relay was built in tandem with GraphQL and is used at Facebook scale.relay.dev · read 2 Oct 2026
Data consistency
Relay maintains a normalized data store so components observing the same data stay in sync.relay.dev · read 3 Oct 2026
Declarative data
Components declare the data they need, and Relay generates queries to fetch it.relay.dev · read 3 Oct 2026
Editor support
Relay editor support provides GraphQL schema autocomplete and go-to-definition.relay.dev · read 3 Oct 2026
Generated types
Relay generates TypeScript types for GraphQL snippets, and the homepage also describes generated Flow or TypeScript types.relay.dev · read 3 Oct 2026
Integrations
The quick start documents setup with React, Vite, TypeScript, Babel, and the Relay Compiler.relay.dev · read 3 Oct 2026
More features
Relay includes loading states, pagination, refetching, optimistic updates, rollbacks, and streamed or deferred data.relay.dev · read 3 Oct 2026
Mutations
Relay supports optimistic updates, error handling, and automatically reverting optimistic changes when mutations fail.relay.dev · read 3 Oct 2026
Network customization
The network layer can be customized for behaviors such as network-level caching, telemetry, or form-data uploads for mutations.relay.dev · read 2 Oct 2026
Network transports
Developers can configure HTTP, WebSockets, and application-appropriate authentication through Relay's network layer.relay.dev · read 2 Oct 2026
Optimizations
Relay aggregates and optimizes component data requirements, including deduplicating identical fields for efficient GraphQL requests.relay.dev · read 3 Oct 2026
Product
Relay is a GraphQL client for React that coordinates component data needs into efficient, pre-loadable queries.relay.dev · read 3 Oct 2026
Production setup
The production guide recommends running the Relay Compiler in CI and keeping generated artifacts in source control.relay.dev · read 2 Oct 2026
React Native
The official documentation says Relay also works with React Native.relay.dev · read 3 Oct 2026
Requirements
Relay requires GraphQL; its homepage says users need a Babel plugin and must run the Relay Compiler.relay.dev · read 3 Oct 2026
Scale
The homepage says Relay is used in Facebook infrastructure across tens of thousands of components and has full-time staff working to improve it.relay.dev · read 3 Oct 2026
Security guidance
Relay recommends persisted queries, also called trusted documents, to restrict clients to queries locked in at build time.relay.dev · read 2 Oct 2026

The review

Overview

Relay is a GraphQL client for React applications, best suited to teams that want components to declare their data needs and receive generated TypeScript or Flow types. Its coordinated data store and built-in mutation and loading patterns make it a strong fit for substantial React interfaces, provided the team is ready to work with GraphQL and Relay’s compiler workflow.

Key features

Relay gathers the data requirements declared by components into optimized queries, deduplicating repeated fields. That can reduce redundant requests as an interface grows, while a normalized store keeps components that observe the same data in sync. The payoff is most relevant in applications with many connected views; it brings conventions that smaller or less complex projects may not need.

Loading states, pagination, refetching, optimistic updates, error handling, and rollback give teams common interface and mutation behaviors within the client. Deferred query parts can stream in and trigger progressive rendering, which helps interfaces show available data before every part is ready. Relay also generates TypeScript types for GraphQL snippets, with Flow support described as well, and editor features include schema autocompletion and go-to-definition.

The network layer can use HTTP or WebSockets and accommodate application-specific authentication. Teams can customize it for network-level caching, telemetry, or form-data uploads. Relay recommends persisted queries, also called trusted documents, to limit clients to queries locked in at build time. Production guidance calls for running the Relay Compiler in CI and keeping generated artifacts in source control.

Pricing

Relay is free, with a free plan and no free trial. That makes it accessible for individual developers and teams evaluating a GraphQL client without a subscription. The plan terms do not state seat limits or usage quotas.

There are no paid Relay tiers to compare. The tradeoff is operational: teams need GraphQL, a Babel plugin, and the Relay Compiler, and production guidance adds CI and source-control steps for generated artifacts. Those requirements are part of the cost of adopting Relay even when the software itself is free.

Platforms

Relay is categorized for Android, iOS, and web. Its documented development use centers on React, with setup guidance for Vite, TypeScript, Babel, and the Relay Compiler; the homepage also describes support out of the box with Create React App and Next.js. The documentation includes React Native support.

Who it's for

Relay suits React teams building GraphQL-backed interfaces that benefit from shared cached data, generated types, and standardized loading and mutation behavior. It is especially compelling when component-level data needs would otherwise produce duplicated fields or drift between views. Teams should also be comfortable with GraphQL Connections when supported by their server and globally unique object IDs, which Relay uses for caching and refetching.

The project says it was built alongside GraphQL and is used at Facebook scale, with full-time staff working on it. That background may reassure teams considering it for large applications, but the compiler, Babel, and server conventions still make it a deliberate architectural choice. A team seeking a standalone GraphQL query interface or a client with fewer stated setup requirements may prefer another tool.

Pros and cons

  • Pros: Component data needs are combined and deduplicated, helping keep GraphQL requests efficient as interfaces grow.
  • Pros: A normalized store keeps observing components in sync, while optimistic updates can be reverted when mutations fail.
  • Pros: Generated TypeScript or Flow types and editor support help catch GraphQL errors during development.
  • Cons: GraphQL, a Babel plugin, and the Relay Compiler are required, creating setup and build work that may be disproportionate for a small app.
  • Cons: Caching and refetching rely on globally unique object IDs, and first-class Connections support depends on server conventions.

Alternatives

Choose Apollo Client if you want a free GraphQL client with a stated plan for up to three developers, self-hosted GraphOS Router capped at 60 requests per minute, one-day data retention, and community support. Choose Altair GraphQL Client if your priority is a query workspace with unlimited collections and history up to 10 revisions on its Basic plan; its Pro plan is 7.99 USD per, with the term not stated.

Apollo Studio is a free GraphQL option with a Forever Free plan for up to three developers, a router capped at 60 requests per minute, and one-day data retention. GraphiQL is a free, MIT-licensed package for use in React applications, making it a direct alternative for teams seeking a GraphQL interface package.

GraphQL Hive has a free Hobby plan with one million operations per month, seven-day usage data retention, and unlimited seats, projects, organizations, and schema pushes. GraphQL Kotlin is a free Apache-licensed option for API or self-hosted use. Hot Chocolate is a free, MIT-licensed option for commercial or private projects. Lighthouse is a free installable PHP package for Laravel or Lumen projects. Browse more tools in GraphQL Tools.

Verdict

Relay is a strong choice for React teams that want optimized component-driven GraphQL queries, shared data consistency, and generated types in one client. Its free plan and mature scale story add appeal, but the required compiler workflow and server conventions make it a poor fit for teams that want a lighter setup or do not use GraphQL.

Alternatives to Relay

Every alternative, ranked