fix: $query wasn't merged, closes #638

This commit is contained in:
Guillaume Chau
2019-09-30 14:45:15 +02:00
parent 2cbdeed7e7
commit 202f39bcb5
+7 -4
View File
@@ -90,12 +90,15 @@ export class DollarApollo {
const apollo = this.vm.$options.apollo
const defaultOptions = this.provider.defaultOptions
let $query
if (apollo && apollo.$query) {
$query = apollo.$query
}
if ((!apollo || !apollo.$query) && defaultOptions && defaultOptions.$query) {
if (defaultOptions && defaultOptions.$query) {
$query = defaultOptions.$query
}
if (apollo && apollo.$query) {
$query = {
...$query || {},
...apollo.$query,
}
}
if ($query) {
// Also replaces 'undefined' values
for (const key in $query) {