Skip to content

Commit

Permalink
fix(composable): Clear previous error when recieving a result (#1120)
Browse files Browse the repository at this point in the history
Co-authored-by: Yannik Rödel <yannik.roedel@iwelt.de>
  • Loading branch information
yrd and yrd committed Jul 4, 2021
1 parent 619b0d1 commit 689c284
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vue-apollo-composable/src/useQuery.ts
Expand Up @@ -250,6 +250,10 @@ export function useQueryImpl<
}

function onNextResult (queryResult: ApolloQueryResult<TResult>) {
// Remove any previous error that may still be present from the last fetch (so result handlers
// don't receive old errors that may not even be applicable anymore).
error.value = null

processNextResult(queryResult)

// Result errors
Expand Down

0 comments on commit 689c284

Please sign in to comment.