Skip to content

Commit df32811

Browse files
committed
Respond to feedback from last working group meeting
1 parent 4dc59ca commit df32811

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

spec/Section 2 -- Language.md

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

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

590-
Fragments allow for the definition of modular selection sets that make it easier
591-
to add and remove selections as needed.
590+
Each client component should declare its data needs in a dedicated fragment.
591+
These fragments may then be composed in the same fashion as the components
592+
themselves to form a GraphQL operation to issue to the server.
592593

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
595-
as friends of some user:
594+
For example, if we have some logic that requires `id`, `name`, and `profilePic`
595+
to render a profile, and we want to apply that logic to the friends and mutual
596+
friends of a user:
596597

597598
```graphql example
598599
query noFragments {
@@ -611,7 +612,7 @@ query noFragments {
611612
}
612613
```
613614

614-
The fields required by `friendProfile` can be extracted into a fragment and
615+
The fields required to render a profile can be extracted into a fragment and
615616
composed by a parent fragment or operation.
616617

617618
```graphql example
@@ -628,17 +629,17 @@ query withFragments {
628629
```
629630

630631
```graphql example
631-
"Fields required to display a friend's profile"
632+
"Fields required to render a friend's profile"
632633
fragment friendProfile on User {
633634
id
634635
name
635636
profilePic(size: 50)
636637
}
637638
```
638639

639-
If `friendProfile` no longer needs `name`, the `name` field can be removed from
640-
the `friendProfile` fragment and it will no longer be fetched in both locations
641-
the fragment is consumed.
640+
If the profile rendering logic no longer needs `name`, the `name` field can be
641+
removed from the `friendProfile` fragment and it will no longer be fetched in
642+
both locations the fragment is consumed.
642643

643644
Fragments are consumed by using the spread operator (`...`). All fields selected
644645
by the fragment will be added to the field selection at the same level as the

0 commit comments

Comments
 (0)