Facilitating the spread of knowledge and innovation in professional software development



Choose your language

InfoQ Homepage News Facebook Releases Relay 7 for Building Data-Driven React Apps with GraphQL

Facebook Releases Relay 7 for Building Data-Driven React Apps with GraphQL

This item in japanese


Relay, a JavaScript framework for building data-driven React applications with GraphQL, was recently updated with the release of version 7. This release contained improvements to error handling and Relay hooks.

A new directive was added in Relay version 7, @DEPRECATED__relay_ignore_unused_variables_error, in order to suppress errors after migration from the GraphQL NoUnusedVariablesRule to RelayIRTransform validation. This directive temporarily suppresses errors that would not have appeared previously, allowing development teams to fix issues incrementally during a Relay upgrade.

The Relay team improved several other features, including the constraint for a @refetchable directive on a fragment no longer enforcing that the argument for the node field is called id, just that it is an ID type. Developers can also now select the __id field wherever __typename can get selected to fetch the internal cache key for an entity to update records without an id.

Beyond several other bug fixes, many experimental features are available with Relay 7. Improvements to the approach of using Relay Hooks include performance improvements for useFragment, correct disposition of ongoing requests with useQuery, and not suspending indefinitely when the server does not return all requested data with useQuery.

Relay is a JavaScript framework built by Facebook for applications using GraphQL. Relay provides a bridge between React and GraphQL. With Relay, React components can specify what data they need and get it, allowing components to get composed while the data needs of the app get localized per component. Relay provides static queries and ahead-of-time code generation.

Relay is open source software available under the MIT license. Contributions and feedback are encouraged via the Relay GitHub project and should follow the Relay contribution guidelines.

A full list of updates and breaking changes may be found in the Relay 7 release notes.

We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.