Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fragment's definition in Learn-Queries.md #1586

Open
wants to merge 2 commits into
base: source
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/content/learn/Learn-Queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ That's why GraphQL includes reusable units called _fragments_. Fragments let you
}
}

# used by the character-rendering UI component
fragment comparisonFields on Character {
name
appearsIn
Expand All @@ -119,7 +120,7 @@ fragment comparisonFields on Character {
}
```

You can see how the above query would be pretty repetitive if the fields were repeated. The concept of fragments is frequently used to split complicated application data requirements into smaller chunks, especially when you need to combine lots of UI components with different fragments into one initial data fetch.
You can see how the above query would be pretty repetitive if the fields were repeated. The concept of fragments is frequently used to define data requirements of a UI component or utility, creating smaller composable chunks. This is especially beneficial when you need to combine lots of UI components with different fragments into one initial data fetch.

### Using variables inside fragments

Expand Down