gitlab-org--gitlab-foss/app/assets/javascripts/lib/graphql.js
2019-02-22 12:54:06 +00:00

11 lines
267 B
JavaScript

import ApolloClient from 'apollo-boost';
import csrf from '~/lib/utils/csrf';
export default (clientState = {}) =>
new ApolloClient({
uri: `${gon.relative_url_root}/api/graphql`,
headers: {
[csrf.headerKey]: csrf.token,
},
clientState,
});