Skip to content

Commit fa92ada

Browse files
committed
fix article parsing
1 parent 19fe2d7 commit fa92ada

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/articles/20190502-apollo-client-in-practice-f81434f6f8d7.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ The way we used Apollo Client was also updated, to create a better separation of
3333

3434
Example of wrapping a component in a Query HOC:
3535

36+
```
3637
const Books = ({ data: { books } }) => (
3738
<ul>
3839
{books.map(book => <li>{book.title}</li>}
@@ -45,6 +46,7 @@ export graphql({ query: gql\`
4546
}
4647
}\`,
4748
variables: { author: "Mickiewicz" })(Books);
49+
```
4850

4951
Apollo reactively updates when using `Query` as a container, basically like the `connect` HOC in Redux. When the `variables` prop on the `Query` component is updated, it will automatically re-query. It uses the cache if possible and falls back to a network call if needed, although this behavior can be configured.
5052

@@ -60,6 +62,7 @@ When using Redux, a common way to transform data in the store is using [Reselect
6062

6163
from a data object
6264

65+
```
6366
{
6467
author: "Mickiewicz",
6568
publications: \[
@@ -69,12 +72,15 @@ from a data object
6972
}
7073
\]
7174
}
75+
```
7276

7377
to an array rows of cells
7478

79+
```
7580
\[
7681
\[ "Mickiewicz", "Pan Tadeusz", "January 1834" \]
7782
\]
83+
```
7884

7985
## Next steps
8086

0 commit comments

Comments
 (0)