Commit adef2f42 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'f_caplette/migrate-writedata-apollo' into 'master'

Remove writeData from pipeline authoring area

See merge request gitlab-org/gitlab!57263
parents 67e85882 390e913b
......@@ -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,
},
});
......
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