Skip to content

teams list / team resolution hard-caps at 50, no pagination — teams beyond page 1 are completely unreachable #71

Description

@TheRealAlexV

Problem

linear teams list uses a GetTeams GraphQL query with no first/after pagination args:

query GetTeams {
  teams {
    nodes {
      id
      name
      key
      description
      issueEstimationType
      issueEstimationAllowZero
      issueEstimationExtended
      defaultIssueEstimate
    }
  }
}

The Linear API returns this in its default page size (50), so any workspace with more than 50 teams silently loses everything past the first page — linear teams list --output json returns exactly 50 entries even though the workspace actually has 178 teams (confirmed via direct Linear API query for the same workspace/token).

This isn't just a listing/display bug: team resolution for --team <key>, linear teams get <key-or-id>, and linear init's team picker all appear to resolve against this same capped/unpaginated list. A team outside the first 50 (e.g. our "Platform Security" / PLATSEC team, confirmed to exist and have issues via direct API lookup) cannot be resolved by key, by name, or even by exact team UUID:

$ linear teams get 3122d282-c31c-4851-b769-fd322c769b6f
Error: failed to get team: failed to resolve team '3122d282-c31c-4851-b769-fd322c769b6f': team not found: 3122d282-c31c-4851-b769-fd322c769b6f

$ linear issues list --team 3122d282-c31c-4851-b769-fd322c769b6f --limit 3
Error: failed to list issues: failed to resolve team '3122d282-c31c-4851-b769-fd322c769b6f': team not found: 3122d282-c31c-4851-b769-fd322c769b6f

For workspaces at this scale, this makes the CLI effectively unusable for the majority of teams, since fetching a specific issue by full identifier (e.g. PLATSEC-617) still works (separate, non-paginated query), but nearly every team-scoped operation does not.

This is the same root cause as #54 (issues list 250-item cap), just on the teams query, with a more severe impact since it breaks name/key/ID resolution entirely rather than just truncating a list.

Proposal

Same fix shape as suggested in #54:

  1. Add cursor pagination to GetTeams (first/after + pageInfo { hasNextPage, endCursor }), and auto-page through all results when resolving a team by key/name/ID, or when --output json needs the full set.
  2. At minimum, surface hasNextPage as a warning/truncation flag so silent data loss is visible.

Verification

Confirmed at the currently installed Homebrew version (linear-cli v1.10.0):

  • linear teams list --output json | jq length50
  • Direct Linear GraphQL query for the same workspace/token → 178 teams total, including Platform Security (key PLATSEC)
  • linear teams get <PLATSEC's real UUID>team not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions