Connect RPC — Generate Typed SDKs from Your GraphQL API | WunderGraph Cosmo - WunderGraph

One contract Every human. Every agent.

Define your API once in GraphQL. Generate typed SDKs for developers and structured endpoints for AI agents — governed, versioned, and ready to ship.

AI-Optimized Interfaces

Purpose-built endpoints AI agents can call — no over-fetching, no ambiguity.

Zero Endpoint Sprawl

SDK, REST, and OpenAPI all derived from one graph. No redundant APIs.

Governed by Default

Compliance, versioning, and schema ownership built into every generated interface.

From Your Operations

query GetEmployee($id: ID!) {
  employee(id: $id) {
    id
    name
    department
  }
}
$ wgc generate

TypeScript SDK

const res = await client
  .GetEmployee({ id: "emp-123" })
res.name       // string
res.department // string
curl /operations/GetEmployee \
  -d '{ "id": "emp-123" }'

# → { name, department }
paths:
  /operations/GetEmployee:
    post:
      operationId: GetEmployee

The Problem

Your next API consumer won't be human.

Three consumers. Three interfaces. One API. Building them by hand means three codebases that drift apart.

One Graph. Every interface generated.

Developer Workflow

From Operation to SDK method

01

Design your dream query

Define the exact GraphQL query shape each consumer requires in Cosmo Studio, including the precise response contract.

02

Save it as an operation

Persist the operation to establish a stable, versioned contract between platform teams and API consumers.

03

Run wgc generate

Run a single generation command to produce typed SDKs, HTTP endpoints, and an OpenAPI specification.

04

Import the SDK and ship

Consumer teams integrate the generated package with autocomplete and compile-time safety, without writing GraphQL queries.

What You Get

One Graph, many interfaces.

GraphQL

The original interface stays available. Consumers who already use GraphQL can keep querying as before — SDK Generation adds new interfaces, it never removes any.

Typed SDKs

Generate strongly typed client libraries for TypeScript, Go, and more. Catch errors at compile time, not at runtime.

OpenAPI Initiative

Auto-generate a complete OpenAPI specification from your operations. Integrate with existing API gateways, documentation tools, and partner portals.

HTTP Endpoints

Every operation becomes a plain HTTP endpoint that accepts and returns JSON. Call it with curl or any HTTP client.

ConnectRPC / gRPC

Use the full power of ConnectRPC for high-performance service-to-service communication.

Code Showcase

Same API. Every protocol.

One set of GraphQL operations generates all of these — switch tabs to compare.

Protocol Generated API
GraphQL Yes
TypeScript SDK Yes
Go SDK Yes
HTTP Yes
OpenAPI Yes

Key Benefits

Your graph, their language

Define your API once and let every consumer — human or machine — use the interface that fits them best.

01

Unlock Your Federated Graph

You already invested in a federated GraphQL layer. Now turn every composed operation into a typed SDK, an HTTP endpoint, and an OpenAPI spec — no extra API surface to build or maintain.

02

GraphQL Without the Exposure

Consumers never touch GraphQL directly. No introspection leaks, no query-complexity attacks. Your graph stays internal; only purpose-built, strongly typed interfaces leave the perimeter.

03

Zero GraphQL Adoption Barrier

Consumer teams call typed SDKs or plain REST — they never write a GraphQL query. You get federation's power on the backend while every consumer speaks the protocol they already know.

Who Is This For

Built for teams with mixed consumers.

Whether you run the platform, build on top of it, or manage an organization where both coexist — there is a workflow for you.

Architecture

Many interfaces. One Gateway.

Let every consumer choose its interface without fragmenting the platform. The federated graph remains the single enforcement point for auth, observability, and governance.

Questions & Answers

Frequently Asked Questions

Do we need to rewrite our existing services to use SDK Generation?

No. You keep your federated graph architecture and existing services.

Will this replace GraphQL for teams already using it?

No.

Can we support SDKs and HTTP APIs without losing centralized governance?

Yes.

Get Started

Generate SDKs from your GraphQL API — today.

Deploy with Cosmo Read the Docs