Skip to content

Commit

Permalink
fix: added client options to error policy (#1318)
Browse files Browse the repository at this point in the history
  • Loading branch information
NataliaTepluhina committed May 3, 2022
1 parent 082acf9 commit 61261bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vue-apollo-composable/src/useQuery.ts
Expand Up @@ -284,8 +284,10 @@ export function useQueryImpl<
function onError (queryError: unknown) {
// any error should already be an ApolloError, but we make sure
const apolloError = toApolloError(queryError)
const client = resolveClient(currentOptions.value?.clientId)
const errorPolicy = currentOptions.value?.errorPolicy || client.defaultOptions?.watchQuery?.errorPolicy

if (currentOptions.value?.errorPolicy !== 'none') {
if (errorPolicy && errorPolicy !== 'none') {
processNextResult((query.value as ObservableQuery<TResult, TVariables>).getCurrentResult())
}
processError(apolloError)
Expand Down

0 comments on commit 61261bc

Please sign in to comment.