Welcome to mirror list, hosted at ThFree Co, Russian Federation.

graphql.js « service_desk « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e01973f1e8a2d904fbc84fefe4641056bcda801d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import createDefaultClient, { createApolloClientWithCaching } from '~/lib/graphql';

let client;

const typePolicies = {
  Project: {
    fields: {
      issues: {
        merge: true,
      },
    },
  },
};

export async function gqlClient() {
  if (client) return client;
  client = gon.features?.frontendCaching
    ? await createApolloClientWithCaching(
        {},
        { localCacheKey: 'service_desk_list', cacheConfig: { typePolicies } },
      )
    : createDefaultClient({}, { cacheConfig: { typePolicies } });
  return client;
}