Skip to content

Commit

Permalink
fix: reuse previous result, fix #1483 (#1569)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum authored Aug 19, 2024
1 parent fceb40c commit 4679a04
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/vue-apollo-composable/src/useQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,13 @@ export function useQueryImpl<
}

function processNextResult (queryResult: ApolloQueryResult<TResult>) {
result.value = queryResult.data && Object.keys(queryResult.data).length === 0 ? undefined : queryResult.data
result.value = queryResult.data && Object.keys(queryResult.data).length === 0
? queryResult.error &&
!currentOptions.value?.returnPartialData &&
currentOptions.value?.errorPolicy === 'none'
? undefined
: result.value
: queryResult.data
loading.value = queryResult.loading
networkStatus.value = queryResult.networkStatus
// Wait for handlers to be registered
Expand Down

0 comments on commit 4679a04

Please sign in to comment.