Add attribute create and update mutations
What does this MR do and why?
Add attribute create and update mutations
Changelog: added
EE: true
How to set up and validate locally
-
Enable
security_categories_and_attributesfeature flag:
Feature.enable(: security_categories_and_attributes) -
Use this GraphQL to create categories:
mutation verify { securityCategoryCreate(input: { namespaceId: "gid://gitlab/Group/<GROUP_ID>", name:"This is a test", description:"This is a desc", multipleSelection: true, }){ securityCategory { id name description }, errors } } -
Use this GraphQL query to create attributes for the created category:
mutation CreateSecurityAttributes { securityAttributeCreate(input: { categoryId: "gid://gitlab/Security::Category/<CATEGORY_ID>", attributes: [ { name: "Name", description: "Description", color: "#FFFFFF" }, { name: "Another Name", description: "Another Description", color: "#FFFFFF" } ] }) { securityAttributes { id name description color editableState securityCategory { id name } } errors } } -
Use this mutation to update an attribute:
mutation UpdateSecurityAttribute { securityAttributeUpdate(input: { id: "gid://gitlab/Security::Attribute/<ATTRIBUTE_ID>", name: "New Name", description: "New Description", color: "#8B0000" }) { securityAttribute { id name description color editableState securityCategory { id name } } 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 Add attributes mutations (#564817 - closed) • Gal Katz • 18.5
Edited by rossfuhrman