diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-11 06:09:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-11 06:09:14 +0300 |
commit | f4b4020ba3e083a1f3a828da755366fbfbb900ce (patch) | |
tree | 45365634493c7ce6fc37e6d46b4f93c3cc2bbc28 /app/assets/javascripts/service_desk/graphql.js | |
parent | 1326fc930c76c78b4943c86b0b18b939004a07ee (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/service_desk/graphql.js')
-rw-r--r-- | app/assets/javascripts/service_desk/graphql.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/assets/javascripts/service_desk/graphql.js b/app/assets/javascripts/service_desk/graphql.js new file mode 100644 index 00000000000..e01973f1e8a --- /dev/null +++ b/app/assets/javascripts/service_desk/graphql.js @@ -0,0 +1,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; +} |