Skip to content

Commit

Permalink
Reword and add additional detail
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Dec 2, 2024
1 parent 9ed3cab commit 0369f61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/source/data/fragments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ function PostDetails({ post }: PostDetailsProps) {
}
```
`FragmentType` also prevents parent components from accidentally omitting fragment definitions for child components, regardless of whether it satisfies the same fields or not.
`FragmentType` also prevents parent components from accidentally omitting fragment spreads for child components, regardless of whether the field selection satisfies the fragment's data requirements.

```tsx title="Posts.tsx"
const GET_POSTS = gql`
Expand All @@ -1308,6 +1308,8 @@ export default function Posts() {
}
```

In this example, the `GetPosts` query selects enough fields to satisfy the `PostDetails` data requirements, but TypeScript warns us because the `PostDetailsFragment` was not included in the `GetPosts` query.

### Incremental adoption in an existing application

Existing applications can take advantage of the data masking features through an incremental adoption approach. This section will walk through the steps needed to adopt data masking in a larger codebase.
Expand Down

0 comments on commit 0369f61

Please sign in to comment.