diff options
Diffstat (limited to 'app/graphql/resolvers/ci/project_pipeline_counts_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/ci/project_pipeline_counts_resolver.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/graphql/resolvers/ci/project_pipeline_counts_resolver.rb b/app/graphql/resolvers/ci/project_pipeline_counts_resolver.rb new file mode 100644 index 00000000000..728bc9627c5 --- /dev/null +++ b/app/graphql/resolvers/ci/project_pipeline_counts_resolver.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Resolvers + module Ci + class ProjectPipelineCountsResolver < BaseResolver + type Types::Ci::PipelineCountsType, null: true + + argument :ref, + GraphQL::Types::String, + required: false, + description: "Filter pipelines by the ref they are run for." + + argument :sha, + GraphQL::Types::String, + required: false, + description: "Filter pipelines by the SHA of the commit they are run for." + + argument :source, + GraphQL::Types::String, + required: false, + description: "Filter pipelines by their source." + + def resolve(**args) + ::Gitlab::PipelineScopeCounts.new(context[:current_user], object, args) + end + end + end +end |