Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.06 KB

README.md

File metadata and controls

53 lines (36 loc) · 1.06 KB

Cosmo Demo

This demo consists of 2 subgraphs

  • posts
  • users

Running Subgraphs Locally

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

Running Router Locally

You can run the router locally without a connection to the control plane by executing the following commands.

  1. First cd into the router directory
cd router
  1. Next generate the router config locally by running the compose command.
wgc router compose --input graph.yaml --out config.json
  1. 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

CI/CD

GitHub actions are setup to do schema checks on pull requests and schema publish on push to main.