Skip to content

Commit 4a81d87

Browse files
committed
Readme update for reactotron-apollo-client
1 parent 2df7e10 commit 4a81d87

File tree

4 files changed

+15
-33
lines changed

4 files changed

+15
-33
lines changed

lib/reactotron-apollo-client/.prettierignore

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

lib/reactotron-apollo-client/.prettierrc

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

lib/reactotron-apollo-client/README.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,29 @@ yarn add -D reactotron-apollo-client
1212

1313
## Usage
1414

15-
Import your mmkv storage instance:
15+
Create your Apollo Client as you normally would, and then add the `reactotron-apollo-client` plugin::
1616

1717
```js
18-
import { MMKV } from "@apollo/client"
19-
export const storage = new MMKV()
18+
import { ApolloClient, InMemoryCache } from "@apollo/client"
19+
20+
const cache = new InMemoryCache()
21+
export const client = new ApolloClient({
22+
uri: "https://api.graphql.guide/graphql",
23+
cache,
24+
defaultOptions: { watchQuery: { fetchPolicy: "cache-and-network" } },
25+
})
2026
```
2127

22-
To use the `mmkvPlugin`, add the additional plugin on the `import` line.
28+
To use the `apolloPlugin`, add the additional plugin on the `import` line.
2329

2430
```js
2531
import Reactotron from "reactotron-react-native"
26-
import mmkvPlugin from "reactotron-apollo-client"
27-
import { storage } from "./mmkv/storage/instance/location" // <--- update this location
32+
import apolloPlugin from "reactotron-apollo-client"
33+
import { client } from "./apolloClient/location" // <--- update this location
2834
...
2935
Reactotron.configure()
30-
.use(mmkvPlugin({ storage })) // <--- here we go!
36+
.use(apolloPlugin({ apolloClient: client })) // <--- here we go!
3137
.connect()
3238
```
3339

34-
And you're done! Now you can see your MMKV in Reactotron.
35-
36-
## Advanced Usage
37-
38-
`mmkvPlugin()` accepts an object with an `ignore` key. The value is an array of strings you would like to prevent sending to Reactotron.
39-
40-
```js
41-
mmkvPlugin({
42-
storage,
43-
ignore: ["secret"],
44-
})
45-
```
40+
And you're done! Now you can see your Apollo caches, queries, and mutations in Reactotron.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./reactotron-apollo-client"

0 commit comments

Comments
 (0)