Skip to content

Commit 497aa7b

Browse files
authored
Update fragment's definition in Learn-Queries.md
Changing the wording on the description of fragments to nudge people towards a more clear usage, like what Relay.dev does.
1 parent 82ddb6f commit 497aa7b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/content/learn/Learn-Queries.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ That's why GraphQL includes reusable units called _fragments_. Fragments let you
110110
}
111111
}
112112

113+
# used by the comparison UI component
113114
fragment comparisonFields on Character {
114115
name
115116
appearsIn
@@ -119,7 +120,7 @@ fragment comparisonFields on Character {
119120
}
120121
```
121122

122-
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.
123+
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.
123124

124125
### Using variables inside fragments
125126

0 commit comments

Comments
 (0)