This demo consists of 2 subgraphs
- posts
- users
You can run the subgraphs with the script as shown below
Posts runs on http://localhost:4001 and users runs on http://localhost:4002
sh ./start-subgraphs.sh
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.localhost.yaml --out config.json
- Finally run the router and head over to http://localhost:3002/graphql
docker run \
--name cosmo-router \
--rm \
-p 3002:3002 \
--add-host=host.docker.internal:host-gateway \
--platform=linux/amd64 \
-e pull=always \
-e DEV_MODE=true \
-e LISTEN_ADDR=0.0.0.0:3002 \
-e EXECUTION_CONFIG_FILE_PATH="/config/config.json" \
-v "$(pwd)/config.json:/config/config.json" \
ghcr.io/wundergraph/cosmo/router:latest
GitHub actions are setup to do schema checks on pull requests and schema publish on push to main.