Create Proposal
Input attributes
When you want to add or create 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 CreateProposal mutation allows authenticated users to create new proposals in a Decidim proposals component. This mutation delegates to the existing Decidim::Proposals::CreateProposal command used by the controllers.
mutation createProposal($componentId: ID!, $input: CreateProposalInput!){
component(id: $componentId) {
...on ProposalsMutation{
createProposal(input: $input) {
id
title {
translation(locale: "en")
}
body {
translation(locale: "en")
}
address
taxonomies{
name {
translation(locale: "en")
}
children{
name{
translation(locale: "en")
}
}
}
}
}
}
}
Example of submitted variables
{
"componentId": 9,
"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
}
}
}