fix: use getCurrentResult()
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user