Skip to main content

Module ops

Module ops 

Source
Expand description

Typed GraphQL operations, generic over GraphQl so tests can drive them with canned JSON.

The field selections here and the structs in super::model have to agree. ISSUE_FIELDS is shared by every query and mutation that returns an issue so there is exactly one place where that agreement is maintained.

Structs§

AssignedIssue
An issue assigned to the viewer, with just enough cycle context to decide whether import --mine should bring it in.
IssuePatch
Fields push may change on an existing Linear issue. None means “leave it alone” — the bridge never writes a field the user did not ask for.
NewIssue
Fields for a new Linear issue. Only what push --create sets.

Constants§

ISSUE_FIELDS
The issue selection, shared by every operation returning an issue.

Functions§

assigned_to_viewer
Every open issue assigned to the token’s viewer, with cycle context.
comment_not_found
Whether an error from update_comment means the comment no longer exists — i.e. someone deleted it in Linear, and the right move is to create a fresh one rather than fail the push.
create_comment
Post a comment and return its Linear id — the id is what lets a later push edit the same comment in place rather than append a new one.
create_issue
issue_by_id
Fetch an issue by its Linear UUID. Used on push, where the link already records the stable id.
issue_by_key
Look an issue up by its human key, e.g. ENG-412.
parse_issue_key
Split ENG-412 into ("ENG", 412).
team_by_key
A team and its workflow states, for status mapping and issue creation.
update_comment
Rewrite an existing comment’s body in place.
update_issue