Skip to content

Add pagination to list commands #1

@hudsonhrh

Description

@hudsonhrh

Problem

List commands (pop task list, pop project list, pop vote list, etc.) currently fetch all results up to the subgraph's hard limit (50-1000 depending on the query). Large orgs with hundreds of tasks will:

  1. Hit GraphQL response limits silently (results truncated)
  2. Produce massive terminal output
  3. Be slow for agents parsing JSON

Proposed Solution

Add --limit and --offset (or --page) flags to all list commands:

pop task list --limit 20 --offset 40   # Page 3
pop task list --page 3 --limit 20      # Same

JSON output should include pagination metadata:

{
  "data": [...],
  "pagination": {
    "total": 150,
    "limit": 20,
    "offset": 40,
    "hasNext": true
  }
}

Implementation Notes

  • task list already has --limit for client-side truncation. This needs to be pushed to the GraphQL first/skip variables for true server-side pagination.
  • Subgraph supports first and skip parameters on all list queries.
  • Need to update queries in src/queries/*.ts to accept pagination variables.

Affected Commands

  • pop task list
  • pop project list
  • pop vote list
  • pop vouch list
  • pop token requests
  • pop treasury distributions
  • pop role applications
  • pop education list
  • pop org list

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions