How I Accidentally Reinvented RPC: A Lightweight Alternative to GraphQL
Author’s Note (2025): When I originally wrote this article, I didn’t realize I was essentially reinventing RPC (Remote Procedure Call) - a pattern that’s been around for decades. What I built here is very similar to JSON-RPC over HTTP, just without knowing it had a name! Today, I’d recommend using battle-tested solutions like tRPC or oRPC which provide the same benefits I was seeking (type safety, simplicity, single endpoint) but with better tooling, community support, and production-readiness. However, I’m keeping this article as-is because building this from scratch taught me valuable lessons about API design, and sometimes reinventing the wheel is the best way to understand why the wheel is shaped the way it is. ...