Skip to content

deps: migrate ID resolvers from LinearSdkClient to GraphQLClient #209

@iamfj

Description

@iamfj

What problem does this solve?

Resolvers currently depend on LinearSdkClient and SDK methods like client.sdk.teams(...), client.sdk.users(...), and client.sdk.issues(...). This keeps the SDK in the command path and preserves a split architecture where resolvers use one client while services use another.

Proposed solution

Migrate SDK-backed resolvers to GraphQLClient and generated GraphQL operations/types.

Affected files:

  • src/resolvers/team-resolver.ts
  • src/resolvers/user-resolver.ts
  • src/resolvers/issue-resolver.ts
  • src/resolvers/project-resolver.ts
  • src/resolvers/label-resolver.ts
  • src/resolvers/status-resolver.ts
  • src/resolvers/cycle-resolver.ts
  • src/resolvers/initiative-resolver.ts
  • src/resolvers/milestone-resolver.ts
  • src/resolvers/issue-filter-resolver.ts

Replace:

LinearSdkClient
client.sdk.*
LinearDocument.*

with:

GraphQLClient
client.request(...)
generated query documents and generated filter types

Alternatives considered

  • Keep resolver usage on SDK and only remove SDK from transport: not sufficient to remove the dependency.
  • Rewrite command flows to use batch resolver queries first: desirable later, but too broad for the dependency-removal migration.

Primary use case

Shell scripting / automation

Additional context

Behavior to preserve:

  • UUID passthrough in all resolvers.
  • Existing not-found error messages.
  • Existing multiple-match handling for users, projects, initiatives, and cycles.
  • Cycle disambiguation order: active > next > previous > single match.
  • Team lookup order: key first, then name.
  • Project includeArchived option.
  • Initiative unscoped, team-scoped, owner-scoped, and team+owner scoped lookup behavior.
  • Team and issue estimation context resolution.

Acceptance criteria:

  • No resolver imports LinearSdkClient.
  • No resolver imports from @linear/sdk.
  • Resolver tests are updated to mock GraphQLClient.request one layer deep.
  • Existing resolver behavior is covered by unit tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P1Highest-priority planned work; should be implemented next

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions