Update Proposal

Input attributes

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

• title       (required) - 15-150 characters
• body        (required) - minimum 15 characters
• address     (optional) - physical address (requires geocoding)
• latitude    (optional) - coordinate
• longitude   (optional) - coordinate
• taxonomies  (optional) - Taxonomies ids to assign to this proposal

Sample request

The UpdateProposal mutation allows authenticated users to update proposals in a Decidim component. This mutation delegates to the existing Decidim::Proposals::UpdateProposal command.

mutation updateProposal($componentId: ID!,$proposalId: ID!, $input: UpdateProposalInput!){
  component(id: $componentId) {
    ...on ProposalsMutation{
      proposal(id: $proposalId) {
        update(input: $input) {
          id
          title { translation(locale: "en") }
          body { translation(locale: "en") }
        }
      }
    }
  }
}

Example of submitted variables

{
  "componentId": 9,
  "proposalId": "140",
  "input": {
    "locale": "en",
    "attributes": {
      "title": "Install Bike Lanes on Main Street",
      "body": "We propose adding dedicated bike lanes along Main Street to improve cyclist safety and encourage sustainable transportation.",
      "address": "Main Street, Barcelona, Spain",
      "latitude": 41.3851,
      "longitude": 2.1734,
      "taxonomies": [123, 456]
    }
  }
}