2021-06-08 01:23:25 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
module Ci
|
|
|
|
class TemplateResolver < BaseResolver
|
|
|
|
type Types::Ci::TemplateType, null: true
|
|
|
|
|
2022-08-27 11:52:29 +05:30
|
|
|
argument :name,
|
|
|
|
GraphQL::Types::String,
|
|
|
|
required: true,
|
|
|
|
description: 'Name of the CI/CD template to search for. ' \
|
|
|
|
'Template must be formatted as `Name.gitlab-ci.yml`.'
|
2021-06-08 01:23:25 +05:30
|
|
|
|
|
|
|
alias_method :project, :object
|
|
|
|
|
|
|
|
def resolve(name: nil)
|
|
|
|
::TemplateFinder.new(:gitlab_ci_ymls, project, name: name).execute
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|