Skip to content

Commit 19482fa

Browse files
author
Guillaume Chau
committed
fix: check errors.length
1 parent 1f15d60 commit 19482fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/vue-apollo/src/smart-query.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export default class SmartQuery extends SmartApollo {
154154
// If `errorPolicy` is set to `all`, an error won't be thrown
155155
// Instead result will have an `errors` array of GraphQL Errors
156156
// so we need to reconstruct an error object similar to the normal one
157-
if (errors) {
157+
if (errors && errors.length) {
158158
const e = new Error(`GraphQL error: ${errors.map(e => e.message).join(' | ')}`)
159159
Object.assign(e, {
160160
graphQLErrors: errors,

0 commit comments

Comments
 (0)