Welcome to mirror list, hosted at ThFree Co, Russian Federation.

branch_commit_resolver.rb « resolvers « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 11c49e17bc57a5a671bc80a87bf945749fc39901 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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