Skip to content

Commit f391a6a

Browse files
author
Guillaume Chau
committed
Version bump
1 parent 015e0a1 commit f391a6a

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

dist/vue-apollo.esm.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3226,7 +3226,7 @@ var ApolloProvider$1 = function () {
32263226
var componentClient = apolloOptions.$client;
32273227
for (var key in apolloOptions) {
32283228
var options = apolloOptions[key];
3229-
if (!options.query || (typeof options.ssr === 'undefined' || options.ssr) && typeof options.prefetch !== 'undefined' && options.prefetch) {
3229+
if (key.charAt(0) !== '$' && (!options.query || (typeof options.ssr === 'undefined' || options.ssr) && typeof options.prefetch !== 'undefined' && options.prefetch)) {
32303230
this.willPrefetchQuery(options, options.client || componentClient);
32313231
}
32323232
}
@@ -3403,7 +3403,6 @@ var prepare = function prepare() {
34033403
if (apollo) {
34043404
this._apolloQueries = {};
34053405
this._apolloInitData = {};
3406-
this.$apollo = new DollarApollo(this);
34073406

34083407
if (!apollo.$init) {
34093408
apollo.$init = true;
@@ -3493,6 +3492,16 @@ function install(Vue, options) {
34933492
return Object.assign(map, merge(toData, fromData));
34943493
};
34953494

3495+
// Lazy creation
3496+
Object.defineProperty(Vue.prototype, '$apollo', {
3497+
get: function get() {
3498+
if (!this._apollo) {
3499+
this._apollo = new DollarApollo(this);
3500+
}
3501+
return this._apollo;
3502+
}
3503+
});
3504+
34963505
Vue.mixin({
34973506

34983507
// Vue 1.x

0 commit comments

Comments
 (0)