Write Plain TypeScript, Get GraphQL
Define your business logic as simple TypeScript functions. Cobalt automatically generates the GraphQL schema and resolvers.
tRPC's speed, GQL's flexibility. No headaches. No compromise.
bunx @cobalt27/dev initDefine a query in server/operations/hello.ts:
export function Query(name: string) {
return `Hello, ${name}!`;
}Use it in your frontend:
import sdk from "sdk";
const greeting = await sdk.query.hello({ name: "Peter" });
// => "Hello, Peter!"That's it! Cobalt handles the GraphQL schema generation, type inference, and SDK creation automatically.