Seamlessly design your API schema with GraphQL Federation and implement your services with gRPC
Features • Demo • Getting Started • License
- Schema-First GraphQL: Define your data contract in SDL and generate type-safe gRPC resolvers instantly
- gRPC Backends: Leverage gRPC's binary protocol for blazing-fast RPC with built-in codegen for go (More languages coming soon)
- API Bridging: Wrap legacy REST or SOAP services behind GraphQL types without rewriting existing backends
- End-to-End Type Safety: Maintain type integrity from schema to transport with auto-generated clients and servers
This demo showcases a federated GraphQL architecture with two different implementation approaches:
- gRPC Users Subgraph: Implemented as a Go-based gRPC Router plugin running directly inside the Cosmo Router - no separate service needed
- Products Subgraph: Traditional standalone GraphQL server using Apollo Server (running on port 3011)
- Cosmo Router: Composes both subgraphs into a unified GraphQL API (running on port 3010)
The architecture demonstrates how the gRPC plugin enables both:
- Embedded subgraphs (Users) with direct router integration for improved performance
- Connecting a REST API to the graph through a gRPC plugin WunderGraph SDK
- Traditional standalone subgraphs (Products) for compatibility with existing systems
- Linux or macOS
- Node.js LTS
- npm or yarn
-
Clone the repository:
git clone https://github.com/wundergraph/cosmo-plugin-demo.git cd cosmo-plugin-demo
-
Install dependencies:
npm install
-
Build the plugin, start the router and the subgraphs:
npm start
-
Open the GraphQL Playground at http://localhost:3010 and run the following query:
query { users { id name email role products { id name price description } } }
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Made with ❤️ by WunderGraph