Skip to content

history issue fails on relation-history payloads #29

Description

@0xTomDaniel

Summary

linear-cli history issue <ISSUE> can fail when an issue's activity contains relation-history events. The command appears to query a field that is not valid for IssueRelationHistoryPayload.

Observed behavior

Running:

linear-cli history issue <ISSUE_ID_WITH_RELATION_HISTORY> --output table --limit 30 --no-pager --no-color

returns:

Error: HTTP 400 Bad Request: Cannot query field "issue" on type "IssueRelationHistoryPayload".

The same happens with JSON output because the GraphQL query fails before rendering.

Expected behavior

linear-cli history issue should render bounded issue activity even when the history contains relation/blocker changes, or omit unsupported relation-specific fields instead of failing the entire history read.

Version / update check

Current installed version where I observed the failure:

linear-cli 0.3.22

linear-cli update --check --output json --compact reports latest as v0.3.25.

I checked the v0.3.25 tagged source and src/commands/history.rs still includes this shape in the history query:

relationChanges {
  type
  issue { identifier }
}

That appears to be the failing field for at least one relation-history payload type.

Working fallback shape

A narrower query that avoids relation-specific fields can read the activity records:

query($id: String!, $limit: Int!) {
  issue(id: $id) {
    id
    identifier
    title
    history(first: $limit) {
      nodes {
        id
        createdAt
        actor { name }
        fromState { name }
        toState { name }
        fromAssignee { name }
        toAssignee { name }
        fromPriority
        toPriority
        addedLabels { name }
        removedLabels { name }
      }
    }
  }
}

Possible fix direction

Use valid fragments/fields for the concrete history payload types returned by Linear, or make relation-change rendering defensive so unsupported relation fields do not break the whole command.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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