2022-08-30 12:12:25 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
module Projects
|
|
|
|
class BranchRulesResolver < BaseResolver
|
2022-10-18 06:09:24 +00:00
|
|
|
include LooksAhead
|
|
|
|
|
2022-08-30 12:12:25 +00:00
|
|
|
type Types::Projects::BranchRuleType.connection_type, null: false
|
|
|
|
|
|
|
|
alias_method :project, :object
|
|
|
|
|
2022-10-18 06:09:24 +00:00
|
|
|
def resolve_with_lookahead(**args)
|
|
|
|
apply_lookahead(project.protected_branches)
|
2022-08-30 12:12:25 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2022-10-18 06:09:24 +00:00
|
|
|
|
|
|
|
Resolvers::Projects::BranchRulesResolver.prepend_mod_with('Resolvers::Projects::BranchRulesResolver')
|