debian-mirror-gitlab/app/assets/javascripts/work_items/graphql/resolvers.js
2022-05-07 20:08:51 +05:30

29 lines
654 B
JavaScript

import workItemQuery from './work_item.query.graphql';
export const resolvers = {
Mutation: {
localUpdateWorkItem(_, { input }, { cache }) {
const workItem = {
__typename: 'LocalWorkItem',
type: 'FEATURE',
id: input.id,
title: input.title,
widgets: {
__typename: 'LocalWorkItemWidgetConnection',
nodes: [],
},
};
cache.writeQuery({
query: workItemQuery,
variables: { id: input.id },
data: { localWorkItem: workItem },
});
return {
__typename: 'LocalUpdateWorkItemPayload',
workItem,
};
},
},
};