Update Debate

Input attributes

When you want to update data in your debates component, you need to rely on the DebateAttributes type, which has the following input fields:

• title                 (required) - String
• description           (required) - String
• taxonomies            (optional) - Taxonomy ids to assign to this debate

Sample request

The UpdateDebate mutation allows authenticated users to update debates in a Decidim debates component. This mutation uses the existing UpdateDebate command from the controller.

mutation updateDebate($componentId: ID!,$debateId: ID!, $input: UpdateDebateInput!){
  component(id: $componentId) {
    ...on DebatesMutation{
      debate(id: $debateId){
        update(input: $input) {
          id
          title { translation(locale: "en") }
          description { translation(locale: "en") }
          taxonomies {
            name { translation(locale: "en") }
          }
        }
      }
    }
  }
}

Example of submitted variables

{
  "componentId": "5",
  "debateId": "9",
  "input": {
    "locale": "en",
    "attributes": {
      "description": "Cities need more people, not more cars",
      "taxonomies": [11],
      "title": "More sidewalks and less roads"
    }
  }
}