This demo consists of 2 subgraphs
- posts
- users
You can run each subgraph as shown below
Posts runs on http://localhost:4001 and users runs on http://localhost:4002
cd subgraph-posts && npm i && npm run dev
cd subgraph-users && npm i && npm run dev
You can run the router locally without a connection to the control plane by executing the following commands.
- First cd into the router directory
cd router
- Next generate the router config locally by running the compose command.
wgc router compose --input graph.yaml --out config.json
- Finally run the router and head over to http://localhost:3001/graphql
docker run \
--rm -it \
--platform=linux/amd64 \
--name cosmo-router \
--env-file .env.local \
-v $(pwd)/config.json:/app/config.json \
-p 3001:3001 \
ghcr.io/wundergraph/cosmo/router:latest
GitHub actions are setup to do schema checks on pull requests and schema publish on push to main.