website/blog/2025-04-02-relay-19.mdx
Relay 19.0.0 includes many documentation improvements, bug fixes, and improved capabilities.
@alias required on conditional fragmentsTo improve type safety, the @alias directive is now required on all fragments that are only conditionally fetched either due to @skip/@include or fragment type conditions which only conditionally match. You can opt out of this validation on a per-fragment basis with the @dangerously_unaliased_fixme directive.
To enable incremental migration we include a codemod which will automatically add the @dangerously_unaliased_fixme in all required places:
npx relay-compiler codemod mark-dangerous-conditional-fragment-spreads
You can also opt out of this validation entirely via compiler config feature flag:
{
// ...
"featureFlags": {
"enforce_fragment_alias_where_ambiguous": {
"kind": "disabled"
}
}
}
We've merged ~30 commits to clean up and improve our docs since the last release:
React 19 is now a valid peer dependency of Relay (#4944) by Krzysztof Karol (commit)
"eagerEsModules": false in your relay.config.json to opt back into the old behavior. (commit)schemaExtensions to Support Both Files and Directories (#4859) by Sverre Johansen (commit)observeFragment() (#4862) by Iha Shin (commit)readFragment export in relay-runtime (#4931) by Jay Jaeho Lee (commit)observeFragment triggering unhandled rejections on network error (#4885) by Iha Shin (commit)Updating Data section of relay docs by Lynn Yu (commit)@module will only work if each fragment is on a different concrete type by Lynn Yu (commit)