Skip to content

Commit 849fcc5

Browse files
committed
feat(withFragment): withFragment HOC
1 parent 5bd18c2 commit 849fcc5

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ function Sample() {
4848
}
4949
```
5050

51+
### `withFragment()`
52+
53+
```js
54+
withFragment(
55+
fragmentDocument: DocumentNode,
56+
optionsObject: {
57+
name: string,
58+
getFragmentId: (props) => string,
59+
}
60+
): HigherOrderComponent
61+
```
62+
63+
After a query has been made with the `graphql` HOC, use this HOC to read fragments from the Apollo Client cache. Based on the options `name`, the fragment data will be returned to the component as props under that key or `data`.
64+
65+
5166
### `withSubscribe()`
5267

5368
```js

withQueryComponent.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)