diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-24 15:09:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-24 15:09:32 +0300 |
commit | a46b489e175708cc64fc5198f458f927558f11ba (patch) | |
tree | 96bb3be8fa37d729d1417b4e91df0bf718039911 /app/assets/javascripts/pipeline_editor | |
parent | bd818d0618b0c1316c23f47f9ae41449e5d41fa8 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/pipeline_editor')
-rw-r--r-- | app/assets/javascripts/pipeline_editor/index.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/assets/javascripts/pipeline_editor/index.js b/app/assets/javascripts/pipeline_editor/index.js index c20eeac8f41..377905c54bb 100644 --- a/app/assets/javascripts/pipeline_editor/index.js +++ b/app/assets/javascripts/pipeline_editor/index.js @@ -3,7 +3,8 @@ import Vue from 'vue'; import VueApollo from 'vue-apollo'; import createDefaultClient from '~/lib/graphql'; import { resetServiceWorkersPublicPath } from '../lib/utils/webpack'; -import { EDITOR_APP_STATUS_LOADING } from './constants'; +import getCommitSha from './graphql/queries/client/commit_sha.graphql'; +import getCurrentBranch from './graphql/queries/client/current_branch.graphql'; import { resolvers } from './graphql/resolvers'; import typeDefs from './graphql/typedefs.graphql'; import PipelineEditorApp from './pipeline_editor_app.vue'; @@ -41,12 +42,19 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { const apolloProvider = new VueApollo({ defaultClient: createDefaultClient(resolvers, { typeDefs }), }); + const { cache } = apolloProvider.clients.defaultClient; - apolloProvider.clients.defaultClient.cache.writeData({ + cache.writeQuery({ + query: getCurrentBranch, data: { currentBranch: initialBranchName || defaultBranch, + }, + }); + + cache.writeQuery({ + query: getCommitSha, + data: { commitSha, - status: EDITOR_APP_STATUS_LOADING, }, }); |