Skip to content

Add `components` field, ComponentType and InputType

Laura Montemayor requested to merge add-components-field-graphql into master

What does this MR do and why?

  • Add the components field to VersionType
  • Add ComponentType
  • Add InputType

Query:

query getCiCatalogResourceDetails {
  ciCatalogResource(id: "gid://gitlab/Ci::Catalog::Resource/13") {
    versions {
      nodes {
        components {
          nodes {
            id
            name
            path
            inputs{
              name
              default
              required
            }
          }
        }
      }
    }
  }
}

Response:

{
  "data": {
    "ciCatalogResource": {
      "versions": {
        "nodes": [
          {
            "components": {
              "nodes": [
                {
                  "id": "gid://gitlab/Ci::Catalog::Resources::Component/3",
                  "name": "chocolate cookie",
                  "inputs": [
                    {
                      "name": "website",
                      "default": null,
                      "required": true
                    }
                  ]
                }
              ]
            }
          }
        ]
      }
    }
  }
}

How to set up and validate locally

The best way to view this is by having a few released components that include inputs.

Example:

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

#425726 (closed)

Edited by Laura Montemayor

Merge request reports