debian-mirror-gitlab/app/graphql/resolvers/projects/fork_details_resolver.rb
2023-03-04 22:38:38 +05:30

21 lines
523 B
Ruby

# frozen_string_literal: true
module Resolvers
module Projects
class ForkDetailsResolver < BaseResolver
type Types::Projects::ForkDetailsType, null: true
argument :ref, GraphQL::Types::String,
required: false,
description: 'Ref of the fork. Default value is HEAD.'
alias_method :project, :object
def resolve(**args)
return unless project.forked?
::Projects::Forks::DivergenceCounts.new(project, args[:ref]).counts
end
end
end
end