Relay
relay.dev
- Free plan
- Web
- iPhone and iPad
- Android
What Relay is
Relay is a free GraphQL client for React that turns component data requirements into optimized, pre-loadable queries. Components declare the fields they need, while Relay aggregates requirements and removes duplicate fields from requests. A normalized data store keeps components observing shared data synchronized. UI support includes loading states, pagination, refetching, optimistic updates, rollbacks, and progressively rendered deferred data. Relay generates TypeScript types for GraphQL snippets and provides editor features such as schema autocompletion and go-to-definition. Developers can configure HTTP or WebSocket transports, authentication, caching, telemetry, and form-data uploads through its network layer. Relay requires GraphQL, a Babel plugin, and the Relay Compiler; production guidance recommends running the compiler in CI and storing generated artifacts in source control. Documentation covers React, Vite, TypeScript, Babel, Create React App, Next.js, and React Native. The project recommends persisted queries to restrict clients to build-time-approved operations.
Who it suits
Relay suits React developers building GraphQL applications, especially teams using Flow or TypeScript and needing generated types, normalized state, and coordinated data loading.
Good to know, and what to watch
- Optimizes and deduplicates component queries
- Normalized store keeps shared data synchronized
- Supports optimistic updates and rollback
- Generated TypeScript types catch errors statically
- Works with React Native
- Requires GraphQL and a Babel plugin
- Requires running the Relay Compiler
- Persisted queries need additional setup
- No free trial is listed
The verdict
Relay provides a structured React approach to GraphQL data requirements, caching, and UI loading behavior. Its compiler and GraphQL prerequisites add setup work, but the client offers strong type and consistency tooling.
What the maker publishes
- Built-in UI patterns
- Relay supports loading states, pagination, refetching, optimistic updates, and rollbacks. source
- 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. source
- Data consistency
- Relay maintains a normalized data store so components observing the same data stay in sync. source
- Declarative data
- Components declare the data they need, and Relay generates optimized queries for them. source
- Declarative data
- Components declare the data they need, and Relay generates queries to fetch it. source
- Editor support
- Relay editor support provides GraphQL schema autocompletion and go-to-definition. source
- Editor support
- Relay editor support provides GraphQL schema autocomplete and go-to-definition. source
- Generated types
- Relay generates TypeScript types for GraphQL snippets, and the homepage also describes generated Flow or TypeScript types. source
- Integrations
- The quick start documents setup with React, Vite, TypeScript, Babel, and the Relay Compiler. source
- More features
- Relay includes loading states, pagination, refetching, optimistic updates, rollbacks, and streamed or deferred data. source
- Mutations
- Relay supports optimistic updates, error handling, and automatically reverting optimistic changes when mutations fail. source
- Network customization
- The network layer can be customized for behaviors such as network-level caching, telemetry, or form-data uploads for mutations. source
- Network transports
- Developers can configure HTTP, WebSockets, and application-appropriate authentication through Relay's network layer. source
- Optimizations
- Relay aggregates and optimizes component data requirements, including deduplicating identical fields for efficient GraphQL requests. source
- Product
- Relay is a GraphQL client for React that combines component data needs into efficient pre-loadable queries. source
- Product
- Relay is a GraphQL client for React that coordinates component data needs into efficient, pre-loadable queries. source
- Production setup
- The production guide recommends running the Relay Compiler in CI and keeping generated artifacts in source control. source
- React Native
- The official documentation says Relay also works with React Native. source
- Requirements
- Relay requires GraphQL; its homepage says users need a Babel plugin and must run the Relay Compiler. source
- 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. source
- Security guidance
- Relay recommends persisted queries, also called trusted documents, to restrict clients to queries locked in at build time. source
- Server conventions
- Relay provides first-class support for GraphQL Connections when the server supports them and relies on globally unique object IDs for caching and refetching. source
- Shared state
- Relay maintains a normalized data store that keeps components observing the same data in sync. source
- Streaming
- Relay can defer parts of a query and progressively re-render the UI as data streams in. source
Checked against the maker's pages on 3 Oct 2026.