debian-mirror-gitlab/app/graphql/resolvers/repository_branch_names_resolver.rb
2021-06-08 01:23:25 +05:30

25 lines
728 B
Ruby

# frozen_string_literal: true
module Resolvers
class RepositoryBranchNamesResolver < BaseResolver
type ::GraphQL::STRING_TYPE, null: false
calls_gitaly!
argument :search_pattern, GraphQL::STRING_TYPE,
required: true,
description: 'The pattern to search for branch names by.'
argument :offset, GraphQL::INT_TYPE,
required: true,
description: 'The number of branch names to skip.'
argument :limit, GraphQL::INT_TYPE,
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