Skip to content

Commit 8d7bf23

Browse files
author
Guillaume Chau
committed
fix(widget): not removed (issue with apollo-client)
1 parent 6f5b0a8 commit 8d7bf23

File tree

1 file changed

+6
-2
lines changed
  • packages/@vue/cli-ui/src/components/dashboard

1 file changed

+6
-2
lines changed

packages/@vue/cli-ui/src/components/dashboard/Widget.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,12 @@ export default {
372372
id: this.widget.id
373373
},
374374
update: (store, { data: { widgetRemove } }) => {
375-
const data = store.readQuery({ query: WIDGETS })
376-
data.widgets = data.widgets.filter(w => w.id !== this.widget.id)
375+
let data = store.readQuery({ query: WIDGETS })
376+
// TODO this is a workaround
377+
// See: https://github.com/apollographql/apollo-client/issues/4031#issuecomment-433668473
378+
data = {
379+
widgets: data.widgets.filter(w => w.id !== this.widget.id)
380+
}
377381
store.writeQuery({ query: WIDGETS, data })
378382
store.writeFragment({
379383
fragment: WIDGET_DEFINITION_FRAGMENT,

0 commit comments

Comments
 (0)