class Fbe::Graph

def total_commits(owner, name, branch)

def total_commits(owner, name, branch)
  result = query(
    <<~GRAPHQL
      {
        repository(owner: "#{owner}", name: "#{name}") {
          ref(qualifiedName: "#{branch}") {
            target {
              ... on Commit {
                history {
                  totalCount
                }
              }
            }
          }
        }
      }
    GRAPHQL
  )
  result.repository.ref.target.history.total_count
end