Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8743266

Browse files
lynnshaoyufacebook-github-bot
authored andcommitted
- make it clear that 3D@module will only work if each fragment is on a different concrete type
Reviewed By: captbaritoneDifferential Revision: D66555487fbshipit-source-id: 86e4cec2c2bca04398bcafbad54a59efff8e861e
1 parenta4b1a4f commit8743266

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

‎website/docs/guides/data-driven-dependencies/client-3d.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ in this example, these separate fragments are `FOO_FRAGMENT`, `BAR_FRAGMENT`, an
184184
to this fragment's data as an argument.
185185
3. Return the final component using Relay's`MatchContainer`, providing the returned query data as a prop.
186186
187+
Notice that in Client 3D, just as in Server 3D, you cannot use`@module` on multiple fragments on the SAME concrete type (but they can be on the same abstract type i.e. a union or an interface).
188+
189+
So in this example,`Client3DFooComponent_Fragment` is on the concrete type`Client3DFoo`, and`Client3DBarComponent_Fragment` is on the concrete type`Client3DBar`. If`Client3DBarComponent_Fragment` was also on`Client3DFoo`, the relay compiler would report an error. However, all three concrete types implement the same parent interface`IClient3D`, which is fine.
190+
187191
<FbInternalOnly>
188192
189193
> **NOTE:** If you are in www, but not in Comet, you should use`RelayFBMatchContainer` instead of`MatchContainer`.

‎website/docs/guides/data-driven-dependencies/server-3d.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ public function commentContentRenderer(Traversable<string> $supported): Awaitabl
276276

277277
Your Relay fragment can now use`@match` to specify that for the`comment_content_renderer` field, we expect dependencies to be decided by the data. In this example, if the`comment_content_renderer` field is of type`CommentMarkdownRenderer`, we load the`CommentMarkdownRenderer.react` component and use the`CommentMarkdownRenderer_comment` fragment to load its data. Similar for the plaintext variant.
278278

279+
>**NOTE:** The inline fragments annotated with`@module` on the same parent 3D fragment must be on distinct concrete types. If they are on the same concrete type, the relay compiler will report an error. So in the example below,`CommentMarkdownRenderer_comment` must be on a different concrete type than`CommentPlaintextRenderer_comment` (for example, the former could be on a`MarkdownComment` type, and the latter on a`PlaintextComment` type. Both could implement a parent interface`Comment`).
280+
279281
On the Relay side you'd write:
280282

281283
```graphql

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp