Commit ed76ea7d authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'vs-add-credentials-option-for-apollo-link' into 'master'

Send credentials with GraphQL fetch requests

Closes #36864

See merge request gitlab-org/gitlab!26386
parents d655b687 43aa0257
...@@ -26,6 +26,10 @@ export default (resolvers = {}, config = {}) => { ...@@ -26,6 +26,10 @@ export default (resolvers = {}, config = {}) => {
headers: { headers: {
[csrf.headerKey]: csrf.token, [csrf.headerKey]: csrf.token,
}, },
// fetch won’t send cookies in older browsers, unless you set the credentials init option.
// We set to `same-origin` which is default value in modern browsers.
// See https://github.com/whatwg/fetch/pull/585 for more information.
credentials: 'same-origin',
}; };
return new ApolloClient({ return new ApolloClient({
......
---
title: Send credentials with GraphQL fetch requests
merge_request: 26386
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment