finds.dev← search

// the find

enisdenjo/graphql-ws

★ 1,870 · TypeScript · MIT · updated Sep 2026

Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client.

graphql-ws is a GraphQL over WebSocket server and client that implements the sub-protocol written up in PROTOCOL.md, with no runtime dependencies. It is for teams that need GraphQL subscriptions over WebSockets and want to move off the deprecated subscriptions-transport-ws, which it explicitly does not interoperate with.

- The protocol logic is separate from transport. The src/use directory holds thin adapters for ws, uWebSockets, Fastify, Bun, Deno and crossws, so switching server runtime does not mean rewriting the message handling.

- The protocol is documented in PROTOCOL.md, and the tests cover the server, client, common code and each adapter. You can check behaviour against the spec rather than reverse-engineering it from the source.

- Zero runtime dependencies keeps the install small and leaves no transitive packages to audit for what is essentially a message state machine.

- The client's lazy mode opens the socket for the first subscription and closes it when the last one completes, which suits apps where most sessions never subscribe.

- The README is mostly links to an external website for the get-started guide, recipes and API docs. Someone reading only the repo learns little about configuration options.

- It is a bespoke sub-protocol, not Apollo's. Both ends have to speak graphql-ws, so any client you do not control, or any existing subscriptions-transport-ws client, needs a migration or a separate implementation.

- The README does not explain what lazy mode costs. Subscriptions that come and go in quick succession will close and reopen the socket each time, and the first subscription pays the connection and handshake latency.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →