Update Budget
Input attributes
When you want to update data in your budget component, you need to rely on the BudgetAttributes type, which has the following input fields:
• title (Optional) - JSON
• description (Optional) - JSON
• total_budget (Optional) - Integer
• weight (Optional) - Integer
Sample request
The UpdateBudget mutation allows authenticated users to update budgets in a Decidim budget component. This mutation uses the existing UpdateBudget command from the admin controller.
mutation updateBudget($componentId: ID!, $budgetId: ID!, $input: UpdateBudgetInput!){
component(id: $componentId){
... on BudgetsMutation {
budget(id: $budgetId){
update(input: $input){
id
url
}
}
}
}
}
Example of submitted variables
{
"componentId": "3",
"budgetId": "5",
"input": {
"attributes": {
"totalBudget": 56700,
"title": {
"en": "Budget title changed from API"
}
}
}
}