Skip to content

Commit

Permalink
2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
l12s-bot committed Nov 16, 2020
1 parent 2967dbc commit d59538d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

## [v2.0.0](https://github.com/little-core-labs/gqlr/compare/v1.2.0...v2.0.0)
## [v2.0.1](https://github.com/little-core-labs/gqlr/compare/v2.0.0...v2.0.1)

### Merged

- bug: fix some issues with the Error object [`#18`](https://github.com/little-core-labs/gqlr/pull/18)

## [v2.0.0](https://github.com/little-core-labs/gqlr/compare/v1.2.0...v2.0.0) - 2020-11-14

### Merged

Expand Down
4 changes: 2 additions & 2 deletions cjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class GraphQLClient {
const { headers, status } = response
return { ...responseBody, headers, status }
} else {
const errorResponseBody = typeof result === 'string' ? { error: responseBody } : responseBody
const errorResponseBody = typeof responseBody === 'string' ? { error: responseBody } : responseBody

let requestBodyObject = requestBody
try {
Expand Down Expand Up @@ -122,7 +122,7 @@ function generateError ({ errorResponseBody, response, requestBodyObject }) {
'There was an error with the request.'
const error = new Error(message)

error.response = { ...errorResponseBody, status: response.status, headers: response.headers }
error.response = { ...errorResponseBody, status: response.status, headers: Object.fromEntries(response.headers.entries()) }
error.request = requestBodyObject

return error
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gqlr",
"version": "2.0.0",
"version": "2.0.1",
"description": "WIP: (g)raph(ql)-(r)equest. A simplified fork of graphql-request",
"type": "module",
"main": "cjs/index.js",
Expand Down

0 comments on commit d59538d

Please sign in to comment.