Skip to content

Commit

Permalink
Add note about nested fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Nov 26, 2024
1 parent fb55cb9 commit 42ee9c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/source/data/fragments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,10 @@ It's important that the parent query or fragment selects any [`keyFields`](../ca
### Nesting fragments in other fragments
<Note>
You can nest fragments with or without data masking (for an example, see the section on [colocating fragments](#colocating-fragments).) The following section describes how you can use masking in components with `useFragment`.
</Note>
As your UI grows in complexity, it is common to split up components into smaller, more reusable chunks. As a result you may end up with more deeply nested components that have their own data requirements. Much like queries, we can nest fragments within other fragments.
Let's add a `Comment` component that will be used by `PostDetails` to render the `topComment` for the post.
Expand Down

0 comments on commit 42ee9c1

Please sign in to comment.