diff options
Diffstat (limited to 'app/assets/javascripts/pipeline_editor/graphql/resolvers.js')
-rw-r--r-- | app/assets/javascripts/pipeline_editor/graphql/resolvers.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/app/assets/javascripts/pipeline_editor/graphql/resolvers.js b/app/assets/javascripts/pipeline_editor/graphql/resolvers.js index a34652b1495..ab908c234d2 100644 --- a/app/assets/javascripts/pipeline_editor/graphql/resolvers.js +++ b/app/assets/javascripts/pipeline_editor/graphql/resolvers.js @@ -1,5 +1,5 @@ -import produce from 'immer'; import axios from '~/lib/utils/axios_utils'; +import getAppStatus from './queries/client/app_status.graphql'; import getCurrentBranchQuery from './queries/client/current_branch.graphql'; import getLastCommitBranchQuery from './queries/client/last_commit_branch.query.graphql'; @@ -31,20 +31,22 @@ export const resolvers = { __typename: 'CiLintContent', })); }, + updateAppStatus: (_, { appStatus }, { cache }) => { + cache.writeQuery({ + query: getAppStatus, + data: { appStatus }, + }); + }, updateCurrentBranch: (_, { currentBranch }, { cache }) => { cache.writeQuery({ query: getCurrentBranchQuery, - data: produce(cache.readQuery({ query: getCurrentBranchQuery }), (draftData) => { - draftData.currentBranch = currentBranch; - }), + data: { currentBranch }, }); }, updateLastCommitBranch: (_, { lastCommitBranch }, { cache }) => { cache.writeQuery({ query: getLastCommitBranchQuery, - data: produce(cache.readQuery({ query: getLastCommitBranchQuery }), (draftData) => { - draftData.lastCommitBranch = lastCommitBranch; - }), + data: { lastCommitBranch }, }); }, }, |