refactor(types): rewritten most types

This commit is contained in:
Guillaume Chau
2019-09-12 19:58:42 +02:00
parent 268d4a56f8
commit ae2e2a30d7
8 changed files with 345 additions and 164 deletions
-2
View File
@@ -9,8 +9,6 @@ export class ApolloProvider {
this.watchLoading = options.watchLoading
this.errorHandler = options.errorHandler
this.prefetch = options.prefetch
this.prefetchQueries = []
}
provide (key = '$apolloProvider') {
+4 -4
View File
@@ -19,10 +19,6 @@ export class DollarApollo {
return this.vm.$apolloProvider
}
query (options) {
return this.getClient(options).query(options)
}
getClient (options = null) {
if (!options || !options.client) {
if (typeof this.client === 'object') {
@@ -48,6 +44,10 @@ export class DollarApollo {
return client
}
query (options) {
return this.getClient(options).query(options)
}
watchQuery (options) {
const observable = this.getClient(options).watchQuery(options)
const _subscribe = observable.subscribe.bind(observable)