Tehnix / playground-federation

Playground to test out Federated GraphQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Playground: Federation

Playground to test out Federated GraphQL.

Install the rover CLI:

curl -sSL https://rover.apollo.dev/nix/latest | sh

and the router itself:

curl -sSL https://router.apollo.dev/download/nix/latest | sh

and finally, we'll be using bun to speed up/simplify running our services:

curl -fsSL https://bun.sh/install | bash

You first start the three subgraphs:

$ cd service-users
$ bun install
$ bun dev
$ cd service-reviews
$ bun install
$ bun dev
$ cd service-products
$ bun install
$ bun dev

We can then compose our subgraphs:

$ rover supergraph compose --config ./supergraph-config.yaml > supergraph.graphql

And then start the router that pieces them together:

$ ./router --config router.yaml --supergraph=supergraph.graphql --dev --hot-reload

Resources

About

Playground to test out Federated GraphQL

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:TypeScript 100.0%