diff options
Diffstat (limited to 'app/assets/javascripts/lib/graphql.js')
-rw-r--r-- | app/assets/javascripts/lib/graphql.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/lib/graphql.js b/app/assets/javascripts/lib/graphql.js index a4c13f9e40e..6ab530576fc 100644 --- a/app/assets/javascripts/lib/graphql.js +++ b/app/assets/javascripts/lib/graphql.js @@ -120,6 +120,8 @@ function createApolloClient(resolvers = {}, config = {}) { cacheConfig = { typePolicies: {}, possibleTypes: {} }, fetchPolicy = fetchPolicies.CACHE_FIRST, typeDefs, + httpHeaders = {}, + fetchCredentials = 'same-origin', path = '/api/graphql', useGet = false, } = config; @@ -138,11 +140,12 @@ function createApolloClient(resolvers = {}, config = {}) { uri, headers: { [csrf.headerKey]: csrf.token, + ...httpHeaders, }, // 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', + credentials: fetchCredentials, batchMax, }; |