Class: Types::Ci::Catalog::Resources::ComponentType

Inherits:
BaseObject
  • Object
show all
Defined in:
app/graphql/types/ci/catalog/resources/component_type.rb

Overview

rubocop: disable Graphql/AuthorizeTypes – Authorization is handled by VersionType

Instance Method Summary collapse

Methods inherited from BaseObject

accepts, assignable?, authorization, authorization_scopes, authorize, authorized?, #current_user, #id

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#inputsObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/graphql/types/ci/catalog/resources/component_type.rb', line 23

def inputs
  object.spec.fetch('inputs', {}).map do |key, value|
    {
      name: key,
      required: !value&.key?('default'),
      default: value&.dig('default'),
      description: value&.dig('description'),
      regex: value&.dig('regex'),
      type: value&.dig('type') || 'string'
    }
  end
end