Skip to content

[Initiative] Query Handler Chain of Responsibility for Standard and Extension Kinds #148

@juliuskrah

Description

@juliuskrah

Summary

Introduce a query-time Chain of Responsibility so resource reads are resolved through explicit handler stages instead of ad-hoc branching. This enables consistent behavior for standard kinds and extension-defined kinds.

In Scope

  • Define a query handler pipeline with ordered stages:
    1. schema/query-shape guard
    2. standard kind resolver (core kinds)
    3. extension resolver (WASI-backed custom kinds)
    4. reference resolution/enrichment stage
  • Implement deterministic stage contracts (input/output/error model) and short-circuit rules
  • Add observability per stage (latency, hit-rate, failures)
  • Support per-kind routing rules so standard and custom kinds can coexist
  • Add tests covering core kind resolution, extension fallback, and mixed-reference resolution

Out of Scope

  • Dynamic GraphQL schema generation/stitching mechanics
  • Marketplace UX for extensions
  • Mutating write-time admission behavior

Acceptance Criteria

  • Query path runs through a documented, ordered handler chain
  • Core kinds resolve through the standard handler path without extension dependency
  • Custom kinds can be resolved via extension handler when registered
  • Reference resolution stage can enrich final objects without changing upstream stage contracts
  • Per-stage metrics/logging/tracing are emitted and actionable
  • Integration tests validate stage ordering and fallback semantics

Implementation Notes

A handler chain makes query behavior explicit and composable. It avoids hard-coding kind checks across resolvers and gives a stable extension seam for non-core kinds. The design should remain level-triggered: each handler receives the current object context and either handles, enriches, or passes onward.

Dependencies

Tracking

  • Area: infra
  • Priority: p2 – high
  • Target Milestone / Release: TBD

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions