Skip to content

Commit

Permalink
Add Clarification on How to Use Fragments (#4300)
Browse files Browse the repository at this point in the history
* Add more color to fragments.md

* highlighted Person

* Changelog update
  • Loading branch information
caydie-tran authored and hwillson committed Jan 14, 2019
1 parent b49de2a commit 2c1a301
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
[@stubailo](https://github.com/stubailo) in [#4220](https://github.com/apollographql/apollo-client/pull/4220) <br/>
[@haysclark](https://github.com/haysclark) in [#4255](https://github.com/apollographql/apollo-client/pull/4255) <br/>
[@shelmire](https://github.com/shelmire) in [#4266](https://github.com/apollographql/apollo-client/pull/4266) <br/>
[@peggyrayzis](https://github.com/peggyrayzis) in [#4280](https://github.com/apollographql/apollo-client/pull/4280)
[@peggyrayzis](https://github.com/peggyrayzis) in [#4280](https://github.com/apollographql/apollo-client/pull/4280) <br/>
[@caydie-tran](https://github.com/caydie-tran) in [#4300](https://github.com/apollographql/apollo-client/pull/4300)

### Apollo Utilities (vNext)

Expand Down
2 changes: 2 additions & 0 deletions docs/source/advanced/fragments.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ query GetPerson {
}
```

It's important to note that the component after the `on` clause is designated for the type we are selecting from. In this case, `people` is of type `Person` and we want to select the `firstName` and `lastName` fields from `people(id: "7)`.

There are two principal uses for fragments in Apollo:

- Sharing fields between multiple queries, mutations or subscriptions.
Expand Down

0 comments on commit 2c1a301

Please sign in to comment.