Create Result
Input attributes
When you want to add or create data in your accountability component, you need to rely on the ResultAttributes type, which has the following input fields:
• decidim_accountability_status_id (Optional) - Integer
• description (Optional) - JSON
• end_date (Optional) - String
• external_id (Optional) - String
• parent_id (Optional) - Integer
• progress (Optional) - Float
• project_ids (Optional) - Array
• proposal_ids (Optional) - Array
• start_date (Optional) - String
• taxonomies (Optional) - Array
• title (Required) - JSON
• weight (Optional) - Integer
Sample request
The CreateResult mutation allows authenticated administrators to create new results in a Decidim accountability component. This mutation uses the existing CreateResult command from the admin controller.
mutation createResult($componentId: ID!, $input: CreateResultInput!){
component(id: $componentId) {
... on AccountabilityMutation {
createResult(input: $input) {
id
url
}
}
}
}
Example of submitted variables
{
"componentId": "3",
"input": {
"attributes": {
"title": { "en": "My Result Title" },
"description": { "en": "A brief description of the project." },
"endDate": "2025-12-31",
"externalId": "EXT-001",
"progress": 0.75,
"proposalIds": [101, 102, 103],
"projectIds": [201, 202],
"startDate": "2024-01-01",
"taxonomies": [301, 302],
"weight": 10,
"decidimAccountabilityStatusId": 5
}
}
}