Commit 23cdfdc1 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Add typeDefs and resolvers to GQL clients

parent eb0990a2
......@@ -4,3 +4,4 @@ export const planTags = {
};
/* eslint-enable @gitlab/require-i18n-strings */
export const CUSTOMER_CLIENT = 'customerClient';
export const GITLAB_CLIENT = 'gitlabClient';
import { merge } from 'lodash';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import purchaseFlowResolvers from 'ee/vue_shared/purchase_flow/graphql/resolvers';
import typeDefs from 'ee/vue_shared/purchase_flow/graphql/typedefs.graphql';
import createClient from '~/lib/graphql';
import { CUSTOMER_CLIENT } from './constants';
import { GITLAB_CLIENT, CUSTOMER_CLIENT } from './constants';
import { resolvers } from './graphql/resolvers';
Vue.use(VueApollo);
const defaultClient = createClient(resolvers, { assumeImmutableResults: true });
const gitlabClient = createClient(merge({}, resolvers, purchaseFlowResolvers), {
typeDefs,
assumeImmutableResults: true,
});
const customerClient = createClient(
{},
{ path: '/-/customers_dot/proxy/graphql', useGet: true, assumeImmutableResults: true },
{
path: '/-/customers_dot/proxy/graphql',
useGet: true,
assumeImmutableResults: true,
},
);
export default new VueApollo({
defaultClient,
defaultClient: gitlabClient,
clients: {
[GITLAB_CLIENT]: gitlabClient,
[CUSTOMER_CLIENT]: customerClient,
},
});
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