diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-21 18:19:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-21 18:19:50 +0300 |
commit | 871e82b7c73283c2c71355e3258a6c9d3b8c0eda (patch) | |
tree | e895b27d313e8df94a160e4820093d0bc25d5a4c /app/assets/javascripts/work_items | |
parent | da9274a8f1939c135f3427947407680faa290052 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/work_items')
5 files changed, 21 insertions, 5 deletions
diff --git a/app/assets/javascripts/work_items/graphql/provider.js b/app/assets/javascripts/work_items/graphql/provider.js index 676fffb12d8..3ea7b118d5d 100644 --- a/app/assets/javascripts/work_items/graphql/provider.js +++ b/app/assets/javascripts/work_items/graphql/provider.js @@ -10,6 +10,11 @@ export function createApolloProvider() { const defaultClient = createDefaultClient(resolvers, { typeDefs, + cacheConfig: { + possibleTypes: { + LocalWorkItemWidget: ['LocalTitleWidget'], + }, + }, }); defaultClient.cache.writeQuery({ @@ -18,7 +23,7 @@ export function createApolloProvider() { id: '1', }, data: { - workItem: { + localWorkItem: { __typename: 'LocalWorkItem', id: '1', type: 'FEATURE', diff --git a/app/assets/javascripts/work_items/graphql/resolvers.js b/app/assets/javascripts/work_items/graphql/resolvers.js index 63d5234d083..60ad290f493 100644 --- a/app/assets/javascripts/work_items/graphql/resolvers.js +++ b/app/assets/javascripts/work_items/graphql/resolvers.js @@ -22,7 +22,11 @@ export const resolvers = { }, }; - cache.writeQuery({ query: workItemQuery, variables: { id }, data: { workItem } }); + cache.writeQuery({ + query: workItemQuery, + variables: { id }, + data: { localWorkItem: workItem }, + }); return { __typename: 'LocalCreateWorkItemPayload', @@ -47,7 +51,11 @@ export const resolvers = { }, }; - cache.writeQuery({ query: workItemQuery, variables: { id: input.id }, data: { workItem } }); + cache.writeQuery({ + query: workItemQuery, + variables: { id: input.id }, + data: { localWorkItem: workItem }, + }); return { __typename: 'LocalUpdateWorkItemPayload', diff --git a/app/assets/javascripts/work_items/graphql/typedefs.graphql b/app/assets/javascripts/work_items/graphql/typedefs.graphql index 177eea00322..9091b08bf10 100644 --- a/app/assets/javascripts/work_items/graphql/typedefs.graphql +++ b/app/assets/javascripts/work_items/graphql/typedefs.graphql @@ -51,7 +51,7 @@ type LocalUpdateWorkItemPayload { } extend type Query { - workItem(id: ID!): LocalWorkItem! + localWorkItem(id: ID!): LocalWorkItem! } extend type Mutation { diff --git a/app/assets/javascripts/work_items/graphql/work_item.query.graphql b/app/assets/javascripts/work_items/graphql/work_item.query.graphql index 9f173f7c302..c4fc7dad56a 100644 --- a/app/assets/javascripts/work_items/graphql/work_item.query.graphql +++ b/app/assets/javascripts/work_items/graphql/work_item.query.graphql @@ -1,7 +1,7 @@ #import './widget.fragment.graphql' query WorkItem($id: ID!) { - workItem(id: $id) @client { + localWorkItem(id: $id) @client { id type widgets { diff --git a/app/assets/javascripts/work_items/pages/work_item_root.vue b/app/assets/javascripts/work_items/pages/work_item_root.vue index 4262e169655..9e6ace5d48e 100644 --- a/app/assets/javascripts/work_items/pages/work_item_root.vue +++ b/app/assets/javascripts/work_items/pages/work_item_root.vue @@ -36,6 +36,9 @@ export default { id: this.id, }; }, + update(data) { + return data.localWorkItem; + }, }, }, computed: { |