Skip to content

Commit b0e60c5

Browse files
author
Guillaume Chau
committed
docs: update smart query result hook
1 parent 5a92745 commit b0e60c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/api/smart-query.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Each query declared in the `apollo` definition (that is, which doesn't start wit
1010
- `debounce`: debounce variables updates (in ms).
1111
- `pollInterval`: auto update using polling (which means refetching every `x` ms).
1212
- `update(data) {return ...}` to customize the value that is set in the vue property, for example if the field names don't match.
13-
- `result(ApolloQueryResult)` is a hook called when a result is received (see documentation for [ApolloQueryResult](https://github.com/apollographql/apollo-client/blob/master/packages/apollo-client/src/core/types.ts)).
13+
- `result(ApolloQueryResult, key)` is a hook called when a result is received (see documentation for [ApolloQueryResult](https://github.com/apollographql/apollo-client/blob/master/packages/apollo-client/src/core/types.ts)). `key` is the query key in the `apollo` option.
1414
- `error(error)` is a hook called when there are errors. `error` is an Apollo error object with either a `graphQLErrors` property or a `networkError` property.
1515
- `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; when it is no longer loading, it will be decremented by 1. That way, the property can represent a counter of currently loading queries.
1616
- `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 loading, or `-1` when the query is no longer loading.

0 commit comments

Comments
 (0)