Add mutation to destroy AI catalog item
What does this MR do and why?
This MR introduces a GraphQL mutation to destroy AI catalog items. This allows users to delete catalog items they no longer need through the GraphQL API.
Implementation details
- Adds aiCatalogAgentDestroy mutation to the GraphQL API
- Accepts catalog item ID as input parameter
- Returns success message and any errors
SQL queries
DELETE FROM
"ai_catalog_items"
WHERE
"ai_catalog_items"."id" = 10
DELETE FROM
"ai_catalog_item_versions"
WHERE
"ai_catalog_item_versions"."id" = 9
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Switch to branch
553293-ai-catalog-agent-item-destroy - Take any catalog item global id you want to delete.
- Execute below mutation from graphql console.
mutation {
aiCatalogAgentDestroy(input: {
id: "gid://gitlab/Ai::Catalog::Item/5"
}) {
success
errors
}
}
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #553293 (closed)
Edited by Lee Tickett