Skip to content

Commit

Permalink
Fix inverted withCredentials logic (closes #97).
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonkearns committed Dec 2, 2018
1 parent 7eabd75 commit 2a024d4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG-ELM-PACKAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [1.5.1] - 2018-11-27

### Fixed

- The `withCredentials` was inverted with release 1.4.0. So it would use
the `Http.risky` and `Http.riskyTask` versions if you _didn't_ call `withCredentials`
, and it would use the regular `Http.request` and `Http.task` builders if you
_did_. Thank you [@kyasu1](https://github.com/kyasu1) for reporting the problem!
See [#97](https://github.com/dillonkearns/elm-graphql/issues/97).

## [1.5.0] - 2018-11-27

### Added

- Add new internal builder function, for use with the new generated code for
building exhaustive Union and Interface fragments.
See this diff to understand the changes and how to migrate:
Expand Down
2 changes: 1 addition & 1 deletion elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "dillonkearns/elm-graphql",
"summary": "Type-safe GraphQL queries in Elm.",
"license": "BSD-3-Clause",
"version": "1.5.0",
"version": "1.5.1",
"exposed-modules": [
"Graphql.Operation",
"Graphql.Http",
Expand Down
12 changes: 6 additions & 6 deletions src/Graphql/Http.elm
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ send resultToMessage ((Request request) as fullRequest) =
fullRequest
|> toHttpRequestRecord resultToMessage
|> (if request.withCredentials then
Http.request
Http.riskyRequest

else
Http.riskyRequest
Http.request
)


Expand All @@ -364,10 +364,10 @@ sendWithTracker tracker resultToMessage ((Request request) as fullRequest) =
|> toHttpRequestRecord resultToMessage
|> (\requestRecord -> { requestRecord | tracker = Just tracker })
|> (if request.withCredentials then
Http.request
Http.riskyRequest

else
Http.riskyRequest
Http.request
)


Expand Down Expand Up @@ -459,10 +459,10 @@ toTask ((Request request) as fullRequest) =
|> toReadyRequest
|> (\readyRequest ->
(if request.withCredentials then
Http.task
Http.riskyTask

else
Http.riskyTask
Http.task
)
{ method = readyRequest.method
, headers = readyRequest.headers
Expand Down

0 comments on commit 2a024d4

Please sign in to comment.