Skip to content

Commit 7c2b460

Browse files
captbaritonefacebook-github-bot
authored andcommitted
Update description of dangerously_unaliased_fixme directive
Reviewed By: gordyf Differential Revision: D64254100 fbshipit-source-id: b3719f92942880d183fb2c772d017ac419669942
1 parent f166d6b commit 7c2b460

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

compiler/crates/relay-schema/src/relay-extensions.graphql

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,17 @@ directive @alias(as: String) on FRAGMENT_SPREAD | INLINE_FRAGMENT
318318
"""
319319
(Relay Only)
320320
321-
This directive allows users to opt out of validation which enforces that @alias
322-
be used on all fragment spreads which might not match. It is intended as an
323-
escape hatch for incremental adoption of enforcing `@alias`.
321+
**To resolve, replace `@dangerously_unaliased_fixme` with `@alias`**
322+
323+
This fragment spread will only conditionally be fetched, either due to
324+
`@skip`/@include` or its type condition. Conditionally fetched fragments without
325+
an `@alias` are unsafe because they don't expose any mechanism for the user to
326+
check if the data was fetched before using the fragment. In these cases `@alias`
327+
will materialize the fragment as a nullable named property, ensuring the proper
328+
null checks are performed.
329+
330+
We now require all such fragment spreads to use `@alias`, and have marked
331+
existing unsafe spreads with `@dangerously_unaliased_fixme`.
324332
325333
DO NOT ADD NEW USES OF THIS DIRECTIVE.
326334

0 commit comments

Comments
 (0)