Skip to content

Commit

Permalink
Update description of dangerously_unaliased_fixme directive
Browse files Browse the repository at this point in the history
Reviewed By: gordyf

Differential Revision: D64254100

fbshipit-source-id: b3719f92942880d183fb2c772d017ac419669942
  • Loading branch information
captbaritone authored and facebook-github-bot committed Oct 11, 2024
1 parent f166d6b commit 7c2b460
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions compiler/crates/relay-schema/src/relay-extensions.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,17 @@ directive @alias(as: String) on FRAGMENT_SPREAD | INLINE_FRAGMENT
"""
(Relay Only)
This directive allows users to opt out of validation which enforces that @alias
be used on all fragment spreads which might not match. It is intended as an
escape hatch for incremental adoption of enforcing `@alias`.
**To resolve, replace `@dangerously_unaliased_fixme` with `@alias`**
This fragment spread will only conditionally be fetched, either due to
`@skip`/@include` or its type condition. Conditionally fetched fragments without
an `@alias` are unsafe because they don't expose any mechanism for the user to
check if the data was fetched before using the fragment. In these cases `@alias`
will materialize the fragment as a nullable named property, ensuring the proper
null checks are performed.
We now require all such fragment spreads to use `@alias`, and have marked
existing unsafe spreads with `@dangerously_unaliased_fixme`.
DO NOT ADD NEW USES OF THIS DIRECTIVE.
Expand Down

0 comments on commit 7c2b460

Please sign in to comment.