2759825251
* * created vuepress docs * chore: upgrade deps * docs: patreon link * Docs changes
1.1 KiB
1.1 KiB
Special options
The special options begin with $ in the apollo object.
$skipto disable all queries and subscriptions (see below)$skipAllQueriesto disable all queries (see below)$skipAllSubscriptionsto disable all subscriptions (see below)$deepto watch withdeep: trueon the properties above when a function is provided$errorto catch errors in a default handler (seeerroradvanced options for smart queries)$queryto apply default options to all the queries in the component
Example:
<script>
export default {
data () {
return {
loading: 0,
}
},
apollo: {
$query: {
loadingKey: 'loading',
},
query1: { ... },
query2: { ... },
},
}
</script>
You can define in the apollo provider a default set of options to apply to the apollo definitions. For example:
const apolloProvider = new VueApollo({
defaultClient: apolloClient,
defaultOptions: {
// apollo options applied to all queries in components
$query: {
loadingKey: 'loading',
fetchPolicy: 'cache-and-network',
},
},
})