@@ -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
2531import 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...
2935Reactotron .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.
0 commit comments