Skip to content

Commit 12793fc

Browse files
committed
Simplify language and remove reference to 'colocation'
1 parent 992fb15 commit 12793fc

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

spec/Section 2 -- Language.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -587,12 +587,11 @@ FragmentName : Name but not `on`
587587

588588
Fragments are the primary unit of composition in GraphQL.
589589

590-
Fragments allow for the definition of selection sets that are colocated with the
591-
logic that requires those selections, making it easier to add and remove selections
592-
as needed.
590+
Fragments allow for the definition of modular selection sets that make it easier
591+
to add and remove selections as needed.
593592

594-
For example, if we have some `friendProfile` logic that requires `id`, `name`,
595-
and `profilePic`, and we want to apply that logic to the mutual friends as well
593+
For example, if we have some `friendProfile` logic that requires `id`, `name`,
594+
and `profilePic`, and we want to apply that logic to the mutual friends as well
596595
as friends of some user:
597596

598597
```graphql example
@@ -612,31 +611,31 @@ query noFragments {
612611
}
613612
```
614613

615-
The fields required by `friendProfile` can be extracted into a fragment and
614+
The fields required by `friendProfile` can be extracted into a fragment and
616615
composed by a parent fragment or operation.
617616

618617
```graphql example
619618
query withFragments {
620619
user(id: 4) {
621620
friends(first: 10) {
622-
...friendProfileFragment
621+
...friendProfile
623622
}
624623
mutualFriends(first: 10) {
625-
...friendProfileFragment
624+
...friendProfile
626625
}
627626
}
628627
}
629628
```
630629
```graphql example
631630
"Fields required to display a friend's profile"
632-
fragment friendProfileFragment on User {
631+
fragment friendProfile on User {
633632
id
634633
name
635634
profilePic(size: 50)
636635
}
637636
```
638-
If `friendProfile` no longer needs `name`, the `name` field can be removed from
639-
`friendProfileFragment` and it will no longer be fetched in both locations the
637+
If `friendProfile` no longer needs `name`, the `name` field can be removed from
638+
the `friendProfile` fragment and it will no longer be fetched in both locations the
640639
fragment is consumed.
641640

642641
Fragments are consumed by using the spread operator (`...`). All fields selected

0 commit comments

Comments
 (0)