Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behaviour of Graphql.Http.withCredentials in 1.5.0 #97

Closed
kyasu1 opened this issue Dec 2, 2018 · 1 comment
Closed

Behaviour of Graphql.Http.withCredentials in 1.5.0 #97

kyasu1 opened this issue Dec 2, 2018 · 1 comment

Comments

@kyasu1
Copy link
Sponsor Contributor

kyasu1 commented Dec 2, 2018

After updating from 1.3.0 to 1.5.0 I got an CORS error. In 1.3.0 my request worked without Graphql.Http.withCredentials, but in 1.5.0 it fails and I need to add it in my request.

You are calling risky variants if withCredentials is False under the hood.

send : (Result (Error decodesTo) decodesTo -> msg) -> Request decodesTo -> Cmd msg
send resultToMessage ((Request request) as fullRequest) =
fullRequest
|> toHttpRequestRecord resultToMessage
|> (if request.withCredentials then
Http.request
else
Http.riskyRequest
)

If my understanding about withCredentials is correct, I think it should be reversed.

@dillonkearns
Copy link
Owner

dillonkearns commented Dec 2, 2018

Thank you so much for reporting this issue @kyasu1! I really appreciate it! Can't believe I mixed that up 🤦‍♂️

I just pushed a fix:

https://github.com/dillonkearns/elm-graphql/blob/master/CHANGELOG-ELM-PACKAGE.md#151---2018-12-01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants