Course 1: Lift-Off — First Supergraph
Course 1 takes you from an empty terminal to a live two-branch supergraph combining an OpenAPI shop service and an MCP notes server behind /graphql and /mcp.
What you'll learn
- Scaffold starter files with
./target/dist/gap initand understand BLAKE3 key digests. - Run fail-closed validation (
gap config checkandgap doctor) before starting listeners. - Query OpenAPI Objects and MCP
JSONscalars together without hittingGAP_UNKNOWN_FIELD.
On this page
Lesson 1: Scaffolding a Workspace (gap init)
In real production setups, you never hand-write TOML boilerplate from scratch. Running gap init creates a ready-to-edit 5-file starter layout containing gap.toml, a sample OpenAPI spec, fixture scripts, and a development bearer token hashed with BLAKE3-256:
./target/dist/gap init my-shop-gateway
ls -la my-shop-gateway
Key Takeaways
gap init <dir>generates a working starter supergraph cleanly.gap.tomlstores BLAKE3 hashes (key_hash), never plaintext production tokens.
Lesson 2: Wiring OpenAPI & MCP Branches (gap config check & doctor)
Open examples/walking-skeleton/gap.toml. Notice two [[branches]] entries: id = "shop" (OpenAPI 3.0 on port 9101) and id = "notes" (MCP HTTP on port 9102/mcp). Validate both files and OS readiness before running traffic:
./target/dist/gap config check examples/walking-skeleton/gap.toml
./target/dist/gap doctor --config examples/walking-skeleton/gap.toml
ok: examples/walking-skeleton/gap.toml (profile=dev, branches=2, api_keys=1)
[ok] config.parse: parsed examples/walking-skeleton/gap.toml (profile=dev)
[ok] config.files: all referenced branch files exist and are readable
[ok] server.listen: valid socket address 127.0.0.1:8080
[ok] auth.api_keys: 1 API key(s) configured
Key Takeaways
gap config checkfails closed on invalid schemas, ports, or missing files.gap doctoraudits sockets, branch file paths, API keys, and sandbox readiness.
Lesson 3: Booting Fixtures & Probing /readyz
Start the two lightweight Python upstream fixtures first, then launch gap serve and inspect /healthz and /readyz:
python3 examples/walking-skeleton/fixtures/rest_fixture.py --port 9101 &
python3 examples/walking-skeleton/fixtures/mcp_fixture.py --port 9102 &
./target/dist/gap serve --config examples/walking-skeleton/gap.toml &
curl -sS http://127.0.0.1:8080/readyz
/readyz returns {"status":"ready","generation":1} only after snapshot generation 1 compiles and binds into the lock-free ArcSwap pointer.
Key Takeaways
/healthztracks process liveness;/readyzturns ready only once Snapshot generation >= 1 compiles.- Alternatively, click Start Live Lab inside the Interactive Lab page to automate all 3 processes.
Lesson 4: First Cross-Branch Query & Hands-On Check
Now send one authenticated POST /graphql request querying customer 1 from the REST branch, their orders from REST, and support notes from the MCP branch simultaneously:
curl -sS http://127.0.0.1:8080/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer gap_dev_skeleton_key_01" \
-d '{"query": "{ customer(id: 1) { id name tier } orders(customer_id: 1) { id status total_cents } customer_notes(customer_id: 1) }"}'
Fix the Query Parameter Name
Complete the cross-branch query so both shop customer #1 and MCP notes for customer #1 resolve together (remember: customer_notes is a JSON scalar!). What argument name goes inside customer_notes(____: 1)?
query {
customer(id: 1) { id name tier }
customer_notes(____: 1)
}
Why does GAP reject customer_notes(customer_id: 1) { notes } during validation?
Key Takeaways
- A single
POST /graphqlquery executes across REST and MCP branches concurrently. - Continue to Course 2: MCP, AG-UI & AI Assistants next.