# ADR-001: Fork graphql-yoga pubsub **Status**: Accepted **Date**: 2026-04-30 ## Context `createPubSub`, `TypedEventTarget`, and operators are adapted from `@graphql-yoga/subscription` and `@graphql-yoga/typed-event-target` (MIT). We carried these into alkhub with modifications (native CustomEvent, our TypedEventTarget types, removed tslib). Now we're extracting to a standalone package. ## Decision Fork (continue carrying adapted code) rather than depend on graphql-yoga packages directly. ## Rationale 1. **Different evolution path** — graphql-yoga's pubsub is tailored for GraphQL subscriptions. Our use case is general-purpose event routing with multiple transports. The APIs will diverge further as we add WebSocket and Iroh adapters. 2. **Dependency reduction** — graphql-yoga's subscription package pulls in `@whatwg-node/events` and `tslib`. We don't need either — we use native `CustomEvent` and no tslib runtime. 3. **Control over types** — graphql-yoga's `TypedEventTarget` uses their own event type hierarchy. We use a simpler one that maps directly to `CustomEvent`. Maintaining our own types avoids version coupling. 4. **Already forked** — the code in alkhub already diverged from the original. The license headers are in place. A clean extraction doesn't change the provenance story. ## Consequences - Must preserve MIT license headers in all forked files - Must update attribution if we make significant changes beyond the original fork scope - No automatic updates from graphql-yoga — we carry our own maintenance burden