Skip to content

Commit a3eb9d5

Browse files
committed
Updated docs
1 parent f926443 commit a3eb9d5

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ this.$apollo.quries.tags.skip = true
399399

400400
These are the available advanced options you can use:
401401
- `update(data) {return ...}` to customize the value that is set in the vue property, for example if the field names don't match.
402-
- `result(data)` is a hook called when a result is received.
402+
- `result(ApolloResult)` is a hook called when a result is received (see documentation for [ApolloResult](http://dev.apollodata.com/core/apollo-client-api.html#ApolloQueryResult)).
403403
- `error(error)` is a hook called when there are errors, `error` being an Apollo error object with either a `graphQLErrors` property or a `networkError` property.
404404
- `loadingKey` will update the component data property you pass as the value. You should initialize this property to `0` in the component `data()` hook. When the query is loading, this property will be incremented by 1 and as soon as it no longer is, the property will be decremented by 1. That way, the property can represent a counter of currently loading queries.
405405
- `watchLoading(isLoading, countModifier)` is a hook called when the loading state of the query changes. The `countModifier` parameter is either equal to `1` when the query is now loading, or `-1` when the query is no longer loading.
@@ -434,7 +434,7 @@ apollo: {
434434
return data.ping
435435
},
436436
// Optional result hook
437-
result(data) {
437+
result({ data, loader, networkStatus }) {
438438
console.log("We got some result!")
439439
},
440440
// Error handling
@@ -1040,20 +1040,27 @@ tags: {
10401040

10411041
(Work in progress)
10421042

1043+
Use `apolloProvider.collect()` to being collect queries made against this provider. You get a function that returns a promise when all queries collected are ready. Note that the provider stops collecting queries when you call the function.
1044+
10431045
```javascript
1044-
const ensureReady = apolloProvider.collect()
1046+
const ensureReady = apolloProvider.collect({
1047+
// If set to false, may resolve when partial/cache result is emitted
1048+
waitForLoaded: true, // default
1049+
})
10451050

10461051
new Vue({
10471052
el: '#app',
10481053
apolloProvider,
10491054
render: h => h(App),
10501055
})
10511056

1052-
ensureReady().then((...results) => {
1053-
console.log('ready', results.length)
1057+
ensureReady().then(results => {
1058+
console.log(results.length, 'queries ready')
10541059
})
10551060
```
10561061

1062+
[White paper](./ssr.js)
1063+
10571064
---
10581065

10591066
LICENCE ISC - Created by Guillaume CHAU (@Akryum)

0 commit comments

Comments
 (0)