debian-mirror-gitlab/app/graphql/resolvers/repository_branch_names_resolver.rb

26 lines
736 B
Ruby
Raw Normal View History

2021-04-29 21:17:54 +05:30
# frozen_string_literal: true
module Resolvers
class RepositoryBranchNamesResolver < BaseResolver
2021-10-27 15:23:28 +05:30
type ::GraphQL::Types::String, null: false
2021-04-29 21:17:54 +05:30
calls_gitaly!
2021-10-27 15:23:28 +05:30
argument :search_pattern, GraphQL::Types::String,
2021-04-29 21:17:54 +05:30
required: true,
description: 'The pattern to search for branch names by.'
2021-10-27 15:23:28 +05:30
argument :offset, GraphQL::Types::Int,
2021-06-08 01:23:25 +05:30
required: true,
description: 'The number of branch names to skip.'
2021-10-27 15:23:28 +05:30
argument :limit, GraphQL::Types::Int,
2021-06-08 01:23:25 +05:30
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
2021-04-29 21:17:54 +05:30
end
end
end