fix: use getCurrentResult()

This commit is contained in:
Guillaume Chau
2020-02-16 19:02:03 +01:00
parent 4624c3e71c
commit d64b0c4281
2 changed files with 4 additions and 4 deletions
@@ -168,7 +168,7 @@ export function useQuery<
startQuerySubscription()
if (!isServer && (currentOptions.value.fetchPolicy !== 'no-cache' || currentOptions.value.notifyOnNetworkStatusChange)) {
const currentResult = query.value.currentResult()
const currentResult = query.value.getCurrentResult()
if (!currentResult.loading || currentOptions.value.notifyOnNetworkStatusChange) {
onNextResult(currentResult as ApolloQueryResult<TResult>)
@@ -222,7 +222,7 @@ export function useQuery<
}
function onError (queryError: any) {
processNextResult(query.value.currentResult() as ApolloQueryResult<TResult>)
processNextResult(query.value.getCurrentResult() as ApolloQueryResult<TResult>)
processError(queryError)
if (firstReject) {
firstReject(queryError)
@@ -128,7 +128,7 @@ export default class SmartQuery extends SmartApollo {
}
maySetLoading (force = false) {
const currentResult = this.observer.currentResult()
const currentResult = this.observer.getCurrentResult()
if (force || currentResult.loading) {
if (!this.loading) {
this.applyLoadingModifier(1)
@@ -199,7 +199,7 @@ export default class SmartQuery extends SmartApollo {
super.catchError(error)
this.firstRunReject()
this.loadingDone(error)
this.nextResult(this.observer.currentResult())
this.nextResult(this.observer.getCurrentResult())
// The observable closes the sub if an error occurs
this.resubscribeToQuery()
}