Relay 18 is out and I’m really excited about the powerful new new capabilities it enables, so I wanted to share them in a thread! 1/9👇
3
20
73
8,451
Our editor integration now include intellisense, autocomplete, hover tooltips, diagnostics for the Relay config file, filling a critical gap in config documentation. Added by @tobiastengler
2
1
7
663
Editor integration now powers powerful rename reactors on operations, fragments, fragment arguments, operations variables. Added by @tobiastengler
1
1
2
453
Editor integration includes inlay hints for fragment arguments and the new alias directive Added by @tobiastengler
1
392
Fragment spreads and inline fragments can now be aliasesed, which will cause them to appear as a named property. This makes it safe to access fragments which were conditionally fetched due to type condition or skip/include since they property will be nullable.
1
1
360
The new catch directive allows you to explicitly handle GraphLQ field errors inside your component.
1
3
343
The new throwOnFieldError directive and semanticNonNull server directive let you access fields have been made nullable in order to absorb errors as non-nullable on the client, by handling errors via error boundaries.

Sep 12, 2024 · 5:42 PM UTC

2
2
360
Relay Resolvers can now access a context object (provided via the Relay environment), just like resolvers on the server! Added by Drew Atkinson and Mark Polak at Microsoft.
2
5
413
Sort replies: Relevant Recent Liked
Replying to @captbaritone
I’m sure I’m missing something simple but how is throwOnFieldError different from required(action: THROW)?
1
2
56
throwOnFieldError only throws if a field was marked as in an error state by the GraphQL server response. Required(action: THROW) blindly throws if the field is null.
1
1
102