Skip to content

type-architecture: replace ad hoc Record<string, unknown> resolver parsing with named SDK projection types #204

@iamfj

Description

@iamfj

What problem does this solve?

Some resolvers use broad Record<string, unknown> plus runtime guards to work around SDK typing limitations. This is understandable, but the projections consumed from SDK nodes are not documented in types.

Proposed solution

Define narrow named projection interfaces for the SDK fields each resolver actually consumes.

Example:

interface IssueTeamProjection {
  id: string;
  teamId?: string;
  team?: unknown | PromiseLike<unknown>;
}

interface TeamLookupProjection {
  id?: string;
  key?: string;
}

Then use parser/reader functions around those projections instead of open-ended Record<string, unknown>.

Acceptance criteria:

  • Replace broad Record<string, unknown> in resolver internals where practical.
  • Runtime validation remains in place.
  • Error messages stay clear.
  • SDK quirks are isolated behind named projections.

Alternatives considered

Keep the current Record<string, unknown> approach. It is flexible but obscures which fields the resolver depends on.

Primary use case

LLM agent integration

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P2Important work, but not part of the immediate implementation queueqa:smell

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions