OSS TanbouSign in with GitHub

GraphQL data framework that colocates queries with React components and manages fetching, caching, mutations, and generated artifacts

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
18,965
Primary language
Rust
License
MIT
Repository last updated
Oct 3, 2026
On this page

Overview

Relay colocates GraphQL data requirements with React views, uses a compiler to generate query artifacts, and relies on a runtime for network requests, normalized storage, caching, mutations, subscriptions, and optimistic updates. It standardizes how UI components declare and consume GraphQL data.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Colocate GraphQL fragments and queries with the views that use them

Components declare required fields in GraphQL, while the Relay compiler validates and transforms those definitions into runtime artifacts.

Sources: [1]

Manage normalized storage, fetch policies, and mutations in the runtime

relay-runtime provides networking, record storage, query execution, mutations, subscriptions, and optimistic updates and merges server responses into a normalized cache.

Sources: [4][1]

Connect generated artifacts to React with hooks

react-relay exposes useLazyLoadQuery, useFragment, useMutation, RelayEnvironmentProvider, and other hooks and components for binding a Relay environment to React.

Sources: [3]

Best fit

Fits large React applications that need consistent GraphQL dependencies and cache behavior

It is useful when teams want view-level data colocation together with standardized request aggregation, normalized caching, and mutation consistency.

Sources: [1]

Before adoption

react-relay 21.0.1 supports React 16.9 through 19

Package metadata declares React ^16.9.0 || ^17 || ^18 || ^19 as its peer range and depends on relay-runtime 21.0.1.

Sources: [2]

Version 21.0.1 fixes missing TypeScript definitions in the published bundle

Version 21.0.0 omitted the new TypeScript definition files from its npm bundle; 21.0.1 fixes the packaging problem.

Sources: [5]

Official sources

  1. [1]Relay v21.0.1 README(2026-10-05)
  2. [2]react-relay 21.0.1 package metadata(2026-10-05)
  3. [3]react-relay 21.0.1 public exports(2026-10-05)
  4. [4]relay-runtime 21.0.1 public exports(2026-10-05)
  5. [5]Relay v21.0.1 release(2026-10-05)
  6. [6]Relay MIT license(2026-10-05)
Supplemental curator note

Relay depends on a GraphQL schema and compiler-generated artifacts, so adoption includes build-pipeline decisions beyond choosing a runtime fetch library.

Try it in 3 steps

  1. 1

    Install pinned Relay 21.0.1

    Create an isolated npm project with the React binding and runtime pinned to the same version.

    demo=$(mktemp -d "${TMPDIR:-/tmp}/relay.XXXXXX") && cd "$demo" && npm init -y >/dev/null && npm install --save-exact react-relay@21.0.1 relay-runtime@21.0.1 react@19.2.0
  2. 2

    Verify both package versions

    Require react-relay and relay-runtime to match the reviewed 21.0.1 release.

    test "$(node -e "console.log(require('react-relay/package.json').version+'/'+require('relay-runtime/package.json').version)")" = '21.0.1/21.0.1'
  3. 3

    Check representative React and runtime exports

    Verify the main React hooks and normalized runtime APIs without connecting to a GraphQL server.

    test "$(node -e "const R=require('react-relay'); const RT=require('relay-runtime'); console.log(['useLazyLoadQuery','useFragment','useMutation','RelayEnvironmentProvider'].every(k=>k in R)&&['Environment','Network','RecordSource','Store'].every(k=>k in RT))")" = 'true'
Check the official README

Growth

Growth trends · Last 30 days

18,965 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
116
Open PRs
227

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data
Stars
18,965
Forks
1,892
Watchers
326
Open issues
638
Contributors
294
Owner type
Organization
Primary language
Rust
License
MIT
Repository last updated
Oct 3, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?