From 3156b2c4823a1adaeb1f480f6ae8c0bf73284d13 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Mon, 7 Jun 2021 14:57:19 +0200 Subject: [PATCH] Remove edges from objective group query --- .../objective-groups/NewObjectiveWizard.vue | 4 +-- .../gql/queries/objectiveGroupQuery.gql | 30 ++++++------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/client/src/components/objective-groups/NewObjectiveWizard.vue b/client/src/components/objective-groups/NewObjectiveWizard.vue index e70fbb5f..757146d6 100644 --- a/client/src/components/objective-groups/NewObjectiveWizard.vue +++ b/client/src/components/objective-groups/NewObjectiveWizard.vue @@ -69,8 +69,8 @@ const variables = {id: this.objectiveGroup}; const data = store.readQuery({query, variables}); if (data.objectiveGroup && data.objectiveGroup.objectives) { - data.objectiveGroup.objectives.edges.push({ - node: objective, + data.objectiveGroup.objectives.push({ + ...objective, __typename: 'ObjectiveNode' }); store.writeQuery({query, variables, data}); diff --git a/client/src/graphql/gql/queries/objectiveGroupQuery.gql b/client/src/graphql/gql/queries/objectiveGroupQuery.gql index 80206606..be8e3842 100644 --- a/client/src/graphql/gql/queries/objectiveGroupQuery.gql +++ b/client/src/graphql/gql/queries/objectiveGroupQuery.gql @@ -3,27 +3,15 @@ query ObjectiveGroupQuery($id: ID!) { objectiveGroup(id: $id) { ...ObjectiveGroupParts objectives { - edges { - node { - id - text - hiddenFor { - edges { - node { - id - name - } - } - } - visibleFor { - edges { - node { - id - name - } - } - } - } + id + text + hiddenFor { + id + name + } + visibleFor { + id + name } } }