Linear GraphQL Patterns

v2026.09.25

This skill should be used when writing or reviewing GraphQL queries against the Linear API — selecting fragments, navigating connection types, batching, and avoiding deprecated fields. Activates on "linear graphql", "linear query", "linear api", "linear schema".

GitHub
安装命令
npx skhub add thelobbi/linear-graphql-patterns
Markdown
SKILL.md

Linear GraphQL Patterns

Reference: https://studio.apollographql.com/public/Linear-API/variant/current/schema/reference

Connection pattern (cursor pagination)

Every list query in Linear returns a Connection type:

{
  issues(first: 50, after: $cursor, filter: {...}, orderBy: updatedAt) {
    pageInfo { hasNextPage endCursor }
    nodes { id identifier title state { name } }
  }
}

Always select pageInfo { hasNextPage endCursor } for cursors. Use first: 50-100 typically; max 250.

Fragment library

Define re-usable fragments in lib/queries/fragments.graphql.ts:

fragment IssueCore on Issue {
  id
  identifier
  title
  priority
  estimate
  dueDate
  url
  state { id name type }
  team { id key name }
  assignee { id email displayName }
  parent { id identifier }
  cycle { id name }
  project { id name }
  labels { nodes { id name color } }
}

Mutation patterns

Mutations return a Payload with success + the entity:

mutation {
  issueCreate(input: { ... }) {
    success
    issue { ...IssueCore }
    lastSyncId
  }
}

Always check success before treating the entity as created.

Sync IDs

Each mutation returns lastSyncId. Pass on subsequent reads (syncId arg) to ensure consistency in eventual-consistency scenarios. Webhook payloads include dataSyncId you can match.

Avoiding the N+1 trap

Use nodes connections aggressively to fetch labels/assignees in one query rather than per-issue resolves.

Deprecation handling

  • Schema: https://linear.app/developers/deprecations
  • The linear-graphql-expert agent inspects PRs touching lib/queries/ and warns on @deprecated fields
  • Common deprecations to watch: legacy archivedAt (now trashed), state string (now state { id name type })

Complexity-aware queries

发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.25

发布时间

2026年9月25日

分类

未分类

许可证

MIT

源路径

plugins/delivery-orchestrator/skills/linear-graphql

默认分支

main

最新提交

2f1269c

Tree SHA

629e050