Skip to content

refactor: rename RepositoryNode.issues field to recent_issues #4175

@miran786

Description

@miran786

Description

The issues field resolver on RepositoryNode is misleadingly named — it does not return all issues for a repository. It returns only the most recent ones, limited by RECENT_ISSUES_LIMIT = 5.

File: backend/apps/github/api/internal/nodes/repository.py, line 51

@strawberry_django.field(prefetch_related=["issues"])
def issues(self, root: Repository) -> list[IssueNode]:
    """Resolve recent issues."""
    # TODO(arkid15r): rename this to recent_issues.
    return root.issues.order_by("-created_at")[:RECENT_ISSUES_LIMIT]

What needs to change

  • Rename the field method from issues to recent_issues
  • Update the prefetch_related key if necessary
  • Update any GraphQL queries or frontend code that references issues on a repository node

Acceptance Criteria

  • Field is renamed to recent_issues in the node definition
  • All consumers of this GraphQL field are updated
  • Existing tests pass; new/updated tests cover the renamed field

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions