Skip to content

wundergraph/cosmo-federation-demos

Repository files navigation

cosmo-federation-demos

This repository contains a demo of WunderGraph Cosmo Federation capabilities. It showcases to implement subgraphs in TypeScript and Go and how to compose them into a federated graph. It uses the command-line wgc to compose a federated schema from multiple subgraphs and the Cosmo Router to run the Federated Graph.

Getting started

We made it easy to get started with the demo. Just follow the steps below.

Prerequisites

  1. Install the dependencies npm install

Running the demo with TypeScript Subgraphs

npm start

Finally, go to http://localhost:3002 and try out the example query ./example-queries.graphql!

Using Go Subgraphs

You can also run subgraphs in Go. To do so, you need to have the Go toolchain installed.

npm start-go

Generating the router configuration (optional)

You can update the subgraph schemas and regenerate the router configuration by running:

npm run compose
# or
npm run compose-go

This will require a restart of the router so press CTRL+C and run npm start again.

💫 If you would like to learn more about federation, check out the WunderGraph Cosmo Documentation!

About

WunderGraph Cosmo Federation demonstrations in TypeScript or Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages