diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-04-02 13:09:16 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-04-02 13:09:16 +0300 |
commit | b7b6f8483d4ce9725779527213a7c94dbb59a757 (patch) | |
tree | 8736336c5f73a6bf1ab0f080becbe3dbde2c9070 /app | |
parent | d7583addf21cd4299363a5ce64126c37ca4234ea (diff) | |
parent | 07e61875de710e9162f7a41b71eea8cd0bca3cf3 (diff) |
Merge branch 'design-management-upload-client-ce' into 'master'
CE backport of design-management-upload-client
See merge request gitlab-org/gitlab-ce!26766
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/lib/graphql.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/app/assets/javascripts/lib/graphql.js b/app/assets/javascripts/lib/graphql.js index 64e4e899f44..ae02559415c 100644 --- a/app/assets/javascripts/lib/graphql.js +++ b/app/assets/javascripts/lib/graphql.js @@ -1,11 +1,16 @@ -import ApolloClient from 'apollo-boost'; +import { ApolloClient } from 'apollo-client'; +import { InMemoryCache } from 'apollo-cache-inmemory'; +import { createUploadLink } from 'apollo-upload-client'; import csrf from '~/lib/utils/csrf'; -export default (clientState = {}) => +export default (resolvers = {}) => new ApolloClient({ - uri: `${gon.relative_url_root}/api/graphql`, - headers: { - [csrf.headerKey]: csrf.token, - }, - clientState, + link: createUploadLink({ + uri: `${gon.relative_url_root}/api/graphql`, + headers: { + [csrf.headerKey]: csrf.token, + }, + }), + cache: new InMemoryCache(), + resolvers, }); |