From 202f39bcb5eeb100d3037fa8b2fcd8b5c2ebc9c3 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Mon, 30 Sep 2019 14:45:15 +0200 Subject: [PATCH] fix: $query wasn't merged, closes #638 --- src/dollar-apollo.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dollar-apollo.js b/src/dollar-apollo.js index 8fc8785..bb69857 100644 --- a/src/dollar-apollo.js +++ b/src/dollar-apollo.js @@ -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) {