diff options
Diffstat (limited to 'app/assets/javascripts/work_items/graphql/resolvers.js')
-rw-r--r-- | app/assets/javascripts/work_items/graphql/resolvers.js | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/app/assets/javascripts/work_items/graphql/resolvers.js b/app/assets/javascripts/work_items/graphql/resolvers.js index 63d5234d083..fb74e27f840 100644 --- a/app/assets/javascripts/work_items/graphql/resolvers.js +++ b/app/assets/javascripts/work_items/graphql/resolvers.js @@ -1,53 +1,24 @@ -import { uuids } from '~/lib/utils/uuids'; import workItemQuery from './work_item.query.graphql'; export const resolvers = { Mutation: { - localCreateWorkItem(_, { input }, { cache }) { - const id = uuids()[0]; - const workItem = { - __typename: 'LocalWorkItem', - type: 'FEATURE', - id, - widgets: { - __typename: 'LocalWorkItemWidgetConnection', - nodes: [ - { - __typename: 'LocalTitleWidget', - type: 'TITLE', - enabled: true, - contentText: input.title, - }, - ], - }, - }; - - cache.writeQuery({ query: workItemQuery, variables: { id }, data: { workItem } }); - - return { - __typename: 'LocalCreateWorkItemPayload', - workItem, - }; - }, - localUpdateWorkItem(_, { input }, { cache }) { - const workItemTitle = { - __typename: 'LocalTitleWidget', - type: 'TITLE', - enabled: true, - contentText: input.title, - }; const workItem = { __typename: 'LocalWorkItem', type: 'FEATURE', id: input.id, + title: input.title, widgets: { __typename: 'LocalWorkItemWidgetConnection', - nodes: [workItemTitle], + nodes: [], }, }; - cache.writeQuery({ query: workItemQuery, variables: { id: input.id }, data: { workItem } }); + cache.writeQuery({ + query: workItemQuery, + variables: { id: input.id }, + data: { localWorkItem: workItem }, + }); return { __typename: 'LocalUpdateWorkItemPayload', |