Skip to content

type-architecture: split common/types.ts into domain-specific projection types #201

@iamfj

Description

@iamfj

What problem does this solve?

src/common/types.ts is a large central module of aliases into generated GraphQL operation shapes. Many names look like stable domain types but are really operation-specific projections, such as Issue from GetIssuesQuery nodes.

This makes generated operation details feel like global domain types and increases coupling.

Proposed solution

Move operation-derived aliases close to the service/domain that owns them and name them as projections.

Examples:

  • IssueListItem instead of Issue
  • IssueDetail
  • IssueWithComments
  • IssueWithAttachments
  • ProjectListItem

Acceptance criteria:

  • common/types.ts no longer imports many unrelated operation types.
  • Type aliases are grouped by domain/service.
  • Projection-specific types have projection-specific names.
  • JSON output shapes remain unchanged.

Alternatives considered

Keep the central file for convenience. This is easy but makes future operation changes ripple through a global type surface.

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