relay README

The project's README from github.com/facebook/relay. As one markdown file: README.md.

Relay · GitHub license npm version

Relay is a JavaScript framework for building data-driven React applications.

See how to use Relay in your own project.

Example

The relay-examples repository contains an implementation of TodoMVC. To try it out:

git clone https://github.com/relayjs/relay-examples.git
cd relay-examples/todo
yarn
yarn grats
yarn relay
yarn dev

Then, just point your browser at http://localhost:5173.

Contribute

We actively welcome pull requests, learn how to contribute.

Users

We have a community-maintained list of people and projects using Relay in production.

License

Relay is MIT licensed.

Thanks

We'd like to thank the contributors that helped make Relay in open source possible.

The open source project relay-hooks allowed the community to experiment with Relay and React Hooks, and was a source of valuable feedback for us. The idea for the useSubscription hook originated in an issue on that repo. Thank you @morrys for driving this project and for playing such an important role in our open source community.

Thank you for helping make this possible!

relay (facebook/relay)

declarative
Searching Database…

19K ·GitHub
What is this?Relay is a JavaScript framework for building data-driven React applications: you declare what data your components need with GraphQL, and Relay handles how and when to fetch it.
How is working with data different from the usual React approach?It is declarative and colocated: instead of imperative calls to your data store, you declare data requirements right next to the views that rely on them, so queries and UI stay together and easier to reason about.
How do I try it out?Clone the relay-examples repository — it contains a TodoMVC implementation you can run and then open in your browser. The README also links to docs for using Relay in your own project.
Do I need a GraphQL backend to use it?Yes. GraphQL is the contract for both reads and writes — you declare data requirements with GraphQL queries and change data with GraphQL mutations — so your app talks to a GraphQL API.
What do I get for mutations?Automatic data consistency, optimistic updates and error handling, for mutations on both the client and the server, all expressed as GraphQL mutations.
Is Relay actually used in production?Yes — the repo keeps a community-maintained list of people and projects running Relay in production, and the project has been on GitHub since 2015.
GitHub shows Rust as the main language — is Relay Rust or JavaScript?The code you install and use is JavaScript — npm packages wired into React apps with Babel. Rust is what GitHub reports as the repo's primary language, which reflects its compiler component.
Does it help keep network traffic down?Yes — Relay aggregates your queries into efficient network requests and fetches only the data your app actually needs.
What are similar projects?hyperapp, gatsby, riot, vuex, nuqs, marked, formily, marko
Creator
facebook
Size
7 GB
Stars
19K
Age
11y
Commits · 90 Days