The Power of GraphQL, Without GraphQL
Cobalt is a TypeScript framework that generates a flexible query-based API transport layer from code, promising GraphQL-like flexibility without manual schema declarations.
summary is enough The landing page is heavy on marketing hype, but the comment thread offers sharp critiques of GraphQL and type-safe RPC frameworks.
summary
Cobalt introduces a code-first approach to API building in TypeScript, attempting to combine the client-driven data fetching of GraphQL with the ergonomics of tRPC. It eliminates separate schema files and boilerplate by inferring the transport layer directly from TypeScript definitions, claiming benefits for both developer velocity and LLM context windows. However, the announcement met considerable skepticism regarding whether it truly solves the architectural pitfalls of flexible query endpoints. The comment section provides a valuable debrief on the long-term pain points of GraphQL and REST paradigms.
key points
- Cobalt uses a single TypeScript source of truth to infer API schemas without manual schema files or code-generation steps.
- It allows clients to query exact data fields dynamically, mimicking GraphQL's flexibility while retaining local-code autocomplete.
- Proponents argue it reduces context overhead for AI coding assistants by keeping code dense and collocated.
who should read it
TypeScript developers evaluating alternative full-stack API frameworks or grappling with the trade-offs of GraphQL and REST.
discussion skeptical
consensus
Commenters largely push back against the tool's framing, arguing that GraphQL and similar flexible query tools introduce unnecessary server complexity, telemetry tracking hurdles, and caching issues compared to standard REST.
pushback
A few note that poorly designed REST APIs frequently evolve into ad-hoc, makeshift versions of GraphQL anyway, meaning structured query flexibility can still solve real problems.
Is this just being upvoted so people can get on their soap boxes about GraphQL? I thought this was going to be something much more interesting.
Where's the fragments, directives, global object identification, subscriptions, updating local data from mutations, being able to apply filters to child entities? Standard spec that's language agnostic? what "power"? This doesn't seem to even come with the server adapters that make GraphQL so powerful (JS example drizzle [1], or pg_grahpql). This reads like a garden variety RPC library built off a poor understanding of GraphQL.
I didn't want to come …
It dissects why the tool is more of a garden-variety RPC library than a true GraphQL successor, highlighting a superficial understanding of GraphQL's actual strengths like fragments and directives.
Generated by an LLM from the article and thread. Check the sources before relying on it.