debian-mirror-gitlab/app/graphql/resolvers/ci/template_resolver.rb

19 lines
501 B
Ruby
Raw Normal View History

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
2021-10-27 15:23:28 +05:30
argument :name, GraphQL::Types::String, required: true,
2021-09-30 23:02:18 +05:30
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