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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
724 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,
2021-11-11 11:23:49 +05:30
description: 'Pattern to search for branch names by.'
2021-04-29 21:17:54 +05:30
2021-10-27 15:23:28 +05:30
argument :offset, GraphQL::Types::Int,
2021-06-08 01:23:25 +05:30
required: true,
2021-11-11 11:23:49 +05:30
description: 'Number of branch names to skip.'
2021-06-08 01:23:25 +05:30
2021-10-27 15:23:28 +05:30
argument :limit, GraphQL::Types::Int,
2021-06-08 01:23:25 +05:30
required: true,
2021-11-11 11:23:49 +05:30
description: 'Number of branch names to return.'
2021-06-08 01:23:25 +05:30
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