Skip to content

Commit df472ab

Browse files
committed
wrap text in error instead of data
1 parent a86f15f commit df472ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class GraphQLClient {
3737
if (response.ok && !result.errors && result.data) {
3838
return result.data
3939
} else {
40-
const errorResult = typeof result === 'string' ? {data: result} : result
40+
const errorResult = typeof result === 'string' ? {error: result} : result
4141
throw new ClientError({ ...errorResult, status: response.status}, {query, variables})
4242
}
4343
}

0 commit comments

Comments
 (0)