P1.3 · Linear GraphQL client with backoff + batching
What
Typed GraphQL client for Linear. Do NOT use @linear/sdk — it bloats the bundle. Write a thin fetch-based client with generated types via graphql-codegen or hand-typed.
Queries needed
viewer— sanity check on API keyteam(id: $teamKey) { states, labels, issues }— bulk pullissues(filter: { updatedAt: { gt: $cursor } })— incremental pullissueUpdate(id, input: { description })— pushissues(filter: { id: { in: $ids } })— batch fetch
Technical requirements
- Exponential backoff on
429and network errors (initial 500ms, max 30s, max 5 retries). - DataLoader-style batching for N individual
issue(id)fetches → oneissues(filter: { id: { in: [...] } })call. - Request timeout: 20s.
- All errors wrapped in typed
LinearApiErrorclasses so the sync engine can route "auth failed" differently from "rate limited".
Acceptance criteria
- Unit tests cover: backoff logic (fake timers), batching coalesces, auth error surfaces cleanly.
- Bundle size delta ≤ 15 KB after gzip.
- Updated
- 2026-04-22