def parse(resp: dict):
    """
    Parse response data for the repo commits query.
    """
    branch = resp["repository"]["defaultBranchRef"]

    branch_name = branch.get("name")

    commit_history = branch["target"]["history"]
    total_commits = commit_history["totalCount"]
    commits = commit_history["nodes"]
    page_info = commit_history["pageInfo"]

    cursor = page_info["endCursor"] if page_info["hasNextPage"] else None

    return branch_name, total_commits, commits, cursor