Set credentials when creating HttpLink #682
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It's possible to set "credentials" option in the GraphQL Playground settings. But it seems that this option is not used when HttpLink is created. This causes problems when user relies on the cookies, e.g. uses cookies for authentication.
Related issues:
#656
#681
#664
Previous PR with the fix, when regular fetch was used:
#470
I've encountered this issue myself, since I'm using cookies for storing session ID. I verified that my API works as expected with GraphiQL (i.e. cookies are being sent). Today was the first time that I've read the Playground's code, so I'm not aware of the conventions etc. I see that there's some refactor going on so tell me how to adapt the code to adhere to the standards.
Also, in the ideal case I think that this PR needs a unit test, since it regressed, but I don't have enough time today.