You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -442,6 +442,7 @@ These are the available advanced options you can use:
442
442
-`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.
443
443
-`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.
444
444
-`manual` is a boolean to disable the automatic property update. If you use it, you then need to specify a `result` callback (see example below).
445
+
-`deep` is a boolean to use `deep: true` on Vue watchers.
445
446
446
447
447
448
```javascript
@@ -460,6 +461,8 @@ apollo: {
460
461
message:this.pingInput,
461
462
}
462
463
},
464
+
// Variables: deep object watch
465
+
deep:false,
463
466
// We use a custom update callback because
464
467
// the field names don't match
465
468
// By default, the 'pingMessage' attribute
@@ -1106,9 +1109,9 @@ The special options begin with `$` in the `apollo` object.
1106
1109
-`$skip` to disable all queries and subscriptions (see below)
1107
1110
-`$skipAllQueries` to disable all queries (see below)
1108
1111
-`$skipAllSubscriptions` to disable all subscriptions (see below)
1109
-
-`$client` to use a client by default (see below)
1110
-
-`$loadingKey` for a default loading key (see `loadingKey` advanced options for smart queries)
1112
+
-`$deep` to watch with `deep: true` on the properties above when a function is provided
1111
1113
-`$error` to catch errors in a default handler (see `error` advanced options for smart queries)
1114
+
-`$query` to apply default options to all the queries in the component
1112
1115
1113
1116
Example:
1114
1117
@@ -1121,7 +1124,9 @@ export default {
1121
1124
}
1122
1125
},
1123
1126
apollo: {
1124
-
$loadingKey:'loading',
1127
+
$query: {
1128
+
loadingKey:'loading',
1129
+
},
1125
1130
query1: { ... },
1126
1131
query2: { ... },
1127
1132
},
@@ -1135,10 +1140,9 @@ You can define in the apollo provider a default set of options to apply to the `
1135
1140
constapolloProvider=newVueApollo({
1136
1141
defaultClient: apolloClient,
1137
1142
defaultOptions: {
1138
-
// apollo options applied to all components that are using apollo
1139
-
$loadingKey:'loading',
1140
1143
// apollo options applied to all queries in components
0 commit comments