What problem does this solve?
src/client/graphql-client.ts imports LinearClient from @linear/sdk only to call linearClient.client.rawRequest(...). This means Linearis cannot remove the SDK even though the transport can be implemented with Node 22 built-in fetch.
Proposed solution
Replace the SDK-backed GraphQL transport with a native implementation in src/client/graphql-client.ts.
The new transport should preserve existing behavior:
- POST to
https://api.linear.app/graphql
- send JSON body
{ "query": print(document), "variables": variables }
- set
Content-Type: application/json
- set
Authorization consistently with current API token usage
- preserve
public-file-urls-expire-in: 3600
- preserve request timeout behavior
- preserve
withRetry() usage
- preserve current authentication/error mapping behavior
If print() remains in runtime code, add graphql as a direct pinned production dependency.
Alternatives considered
- Keep using
LinearClient.client.rawRequest(...): simplest short term, but leaves the SDK dependency in the critical path.
- Add another GraphQL HTTP client dependency: unnecessary on Node 22 because
fetch is available.
Primary use case
Shell scripting / automation
Additional context
Current files involved:
src/client/graphql-client.ts
tests/unit/client/graphql-client.test.ts
package.json
package-lock.json
Acceptance criteria:
src/client/graphql-client.ts no longer imports @linear/sdk.
- Unit tests mock native
fetch instead of the SDK.
- Existing timeout, retry, auth error, and GraphQL error behavior is covered.
npm test, npm run check:ci, and typecheck pass.
What problem does this solve?
src/client/graphql-client.tsimportsLinearClientfrom@linear/sdkonly to calllinearClient.client.rawRequest(...). This means Linearis cannot remove the SDK even though the transport can be implemented with Node 22 built-infetch.Proposed solution
Replace the SDK-backed GraphQL transport with a native implementation in
src/client/graphql-client.ts.The new transport should preserve existing behavior:
https://api.linear.app/graphql{ "query": print(document), "variables": variables }Content-Type: application/jsonAuthorizationconsistently with current API token usagepublic-file-urls-expire-in: 3600withRetry()usageIf
print()remains in runtime code, addgraphqlas a direct pinned production dependency.Alternatives considered
LinearClient.client.rawRequest(...): simplest short term, but leaves the SDK dependency in the critical path.fetchis available.Primary use case
Shell scripting / automation
Additional context
Current files involved:
src/client/graphql-client.tstests/unit/client/graphql-client.test.tspackage.jsonpackage-lock.jsonAcceptance criteria:
src/client/graphql-client.tsno longer imports@linear/sdk.fetchinstead of the SDK.npm test,npm run check:ci, and typecheck pass.