debian-mirror-gitlab/app/assets/javascripts/work_items/graphql/resolvers.js

30 lines
654 B
JavaScript
Raw Normal View History

2022-01-26 12:08:38 +05:30
import workItemQuery from './work_item.query.graphql';
export const resolvers = {
Mutation: {
localUpdateWorkItem(_, { input }, { cache }) {
const workItem = {
__typename: 'LocalWorkItem',
type: 'FEATURE',
id: input.id,
2022-05-07 20:08:51 +05:30
title: input.title,
2022-01-26 12:08:38 +05:30
widgets: {
__typename: 'LocalWorkItemWidgetConnection',
2022-05-07 20:08:51 +05:30
nodes: [],
2022-01-26 12:08:38 +05:30
},
};
2022-05-07 20:08:51 +05:30
cache.writeQuery({
query: workItemQuery,
variables: { id: input.id },
data: { localWorkItem: workItem },
});
2022-01-26 12:08:38 +05:30
return {
__typename: 'LocalUpdateWorkItemPayload',
workItem,
};
},
},
};