debian-mirror-gitlab/app/graphql/resolvers/branch_commit_resolver.rb
2020-05-24 23:13:21 +05:30

17 lines
343 B
Ruby

# frozen_string_literal: true
module Resolvers
class BranchCommitResolver < BaseResolver
type Types::CommitType, null: true
alias_method :branch, :object
def resolve(**args)
return unless branch
commit = branch.dereferenced_target
::Commit.new(commit, context[:branch_project]) if commit
end
end
end