Skip to content

Mutation for adding requirements to a compliance framework

Hitesh Raghuvanshi requested to merge 470695-requirements-mutations into master

What does this MR do and why?

This MR adds a GraphQL mutation for adding requirements to a compliance framework.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. You must have a group with GitLab Ultimate license for testing this.
  2. Make sure the group has at least one compliance framework associated with it. If not then you can follow steps mentioned here for creating one.
  3. Now open the graphql explorer, for example http://gdk.test:3000/-/graphql-explorer, and run the following mutation
mutation createComplianceRequirement {
  createComplianceRequirement(
    input: {
      complianceFrameworkId: "gid://gitlab/ComplianceManagement::Framework/<framework_id>",
      params: {
        name: "Custom req 1",
        description: "some description"
      }
    }) {
    errors
    requirement {
      id
      name
      description
    }
  }
}
  1. You should not get any error while running this and response would be something like:
{
  "data": {
    "createComplianceRequirement": {
      "errors": [],
      "requirement": {
        "id": "gid://gitlab/ComplianceManagement::ComplianceFramework::ComplianceRequirement/3",
        "name": "Custom req 1",
        "description": "some description"
      }
    }
  }
}

Related to #470695

Edited by Hitesh Raghuvanshi

Merge request reports

Loading