Welcome to mirror list, hosted at ThFree Co, Russian Federation.

repository_branch_names_resolver.rb « resolvers « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e9aacda26527b3a35cfe52372580ad3dd2b6072a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

module Resolvers
  class RepositoryBranchNamesResolver < BaseResolver
    type ::GraphQL::Types::String, null: false

    calls_gitaly!

    argument :search_pattern, GraphQL::Types::String,
      required: true,
      description: 'The pattern to search for branch names by.'

    argument :offset, GraphQL::Types::Int,
      required: true,
      description: 'The number of branch names to skip.'

    argument :limit, GraphQL::Types::Int,
      required: true,
      description: 'The number of branch names to return.'

    def resolve(search_pattern:, offset:, limit:)
      Repositories::BranchNamesFinder.new(object, offset: offset, limit: limit, search: search_pattern).execute
    end
  end
end