diff options
Diffstat (limited to 'app/graphql/resolvers/ci/template_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/ci/template_resolver.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/graphql/resolvers/ci/template_resolver.rb b/app/graphql/resolvers/ci/template_resolver.rb new file mode 100644 index 00000000000..dd910116544 --- /dev/null +++ b/app/graphql/resolvers/ci/template_resolver.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Resolvers + module Ci + class TemplateResolver < BaseResolver + type Types::Ci::TemplateType, null: true + + argument :name, GraphQL::STRING_TYPE, required: true, + description: 'Name of the CI/CD template to search for.' + + alias_method :project, :object + + def resolve(name: nil) + ::TemplateFinder.new(:gitlab_ci_ymls, project, name: name).execute + end + end + end +end |