Skip to content

Commit

Permalink
fix: 🐛 add missing graphql error
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayKnight committed Oct 15, 2020
1 parent 5694488 commit a6bc855
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ export async function fetchViaGraphQL(
cache: new InMemoryCache(),
})

const { data, errors } = await instance.query<unknown>({
const { data, error, errors } = await instance.query<unknown>({
query: unpack(query),
variables,
fetchPolicy: 'network-only',
})

if (errors) {
throw errors
if (error || (errors && errors.length)) {
throw error || errors[0]
}

return data
Expand Down

0 comments on commit a6bc855

Please sign in to comment.