fix: check errors.length
This commit is contained in:
@@ -154,7 +154,7 @@ export default class SmartQuery extends SmartApollo {
|
||||
// If `errorPolicy` is set to `all`, an error won't be thrown
|
||||
// Instead result will have an `errors` array of GraphQL Errors
|
||||
// so we need to reconstruct an error object similar to the normal one
|
||||
if (errors) {
|
||||
if (errors && errors.length) {
|
||||
const e = new Error(`GraphQL error: ${errors.map(e => e.message).join(' | ')}`)
|
||||
Object.assign(e, {
|
||||
graphQLErrors: errors,
|
||||
|
||||
Reference in New Issue
Block a user