Skip to content

Bug: tasks --cycle next errors with 'Cannot query field "nextCycle" on type "Team"' #3

@muqsitnawaz

Description

@muqsitnawaz

Reproducer

$ linear tasks --all --cycle next
Error: Cannot query field "nextCycle" on type "Team".

Root cause

linear line 615 and line 690 build the GraphQL query with team.nextCycle:

# line 615 (list_tasks)
cycle_field = "activeCycle" if args.cycle != "next" else "nextCycle"

# line 690 (show_board) — same pattern
cycle_field = "activeCycle" if args.cycle != "next" else "nextCycle"

But the project itself already documents that this field does not exist — linear line 238, in the cycle-resolution helper:

# "next" — Linear has no team.nextCycle field. Find the first cycle whose
# startsAt is after the active cycle's endsAt, ordered ascending.

The helper (lines 240–274) does the right thing: query activeCycle.endsAt, then cycles(filter: { startsAt: { gte: $after } }, orderBy: updatedAt, first: 20) and take the earliest.

list_tasks and show_board never call that helper — they go straight to the non-existent nextCycle field on Team and Linear's GraphQL rejects the query.

Fix

Resolve the next-cycle ID with the existing helper (or factor it out), then change both query bodies to filter issues by cycle: { id: { eq: $cycleId } } instead of nesting under team.<cycle_field>.

Impact

Anyone doing weekly triage who wants to see what's coming up next gets a confusing GraphQL error instead of a useful list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions