You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
The old ApolloClient automatically passed cookies.
HttpLink, BatchHttpLink uses apollo-fetch, which uses isomorphic-fetch. By default, isomorphic-fetch doesn't send cookies.
The current workaround is pretty complicated:
consturi='/api/graphql';// by default, apollo-link-http doesn't send cookiesconstcustomFetch=(uri,options)=>fetch(uri,{
...options,credentials: 'same-origin',});// create an apollo fetch instance with our hacked fetch instanceconstapolloFetch=createApolloFetch({
uri,
customFetch,});constlink=newBatchHttpLink({ uri,fetch: apolloFetch})
This problem can be solved in multiple ways:
we could enable it by default to mimic the old version
we could add another option to apollo-link-http and apollo-link-batch-http, called fetchOption, so we could just do something like
I'm not sure this is truly a full duplicate of #44. That issue only addressed HttpLink, not BatchHttpLink. We still need to use that same workaround until BatchHttpLink is updated to also support credentials.
Can we re-open this issue until BatchHttpLink is also addressed?
The old ApolloClient automatically passed cookies.
HttpLink, BatchHttpLink uses apollo-fetch, which uses isomorphic-fetch. By default, isomorphic-fetch doesn't send cookies.
The current workaround is pretty complicated:
This problem can be solved in multiple ways:
fetchOption
, so we could just do something likeI'm willing to do the fix + the tests, just need help on figuring which way we want to go :-)
Intended outcome:
Cookies should be sent when doing a request
Actual outcome:
No cookies are being sent
The text was updated successfully, but these errors were encountered: