Diagram-First Mechanics & Interactive Sandboxes
Distributed Router, Registry, Edge Cache, Security & Realtime
No matching labs found
Try another directive or keyword, or reset your active filters.
Build deep intuition with interactive AST, DataLoader, Entity, Query Planner, and @defer sandboxes first—then architect distributed Apollo Routers, zero-downtime schema registries, edge APQ caching, zero-trust security, and 250K-WS subscription pipelines under live chaos drills.
Try another directive or keyword, or reset your active filters.
| Directive | Purpose | Production Gotcha |
|---|---|---|
@key(fields: "id") |
Declares a distributed entity primary key for Query._entities joins. |
Use resolvable: false for lightweight reference stubs that don't implement __resolveReference. |
@shareable |
Allows multiple subgraphs to resolve the same field identically. | Must be declared in every subgraph that owns the field, or composition fails with SHAREABLE_CONFLICT. |
@external |
Marks a field as owned by another subgraph (used with @requires / @provides). |
Forgetting @external on a required dependency triggers SATISFIABILITY_ERROR. |
@requires(fields: "...") |
Instructs Router to fetch fields from another subgraph before calling this resolver. | Adds a mandatory serial hop (+1 wave) to the Query Plan DAG critical path. |
@provides(fields: "...") |
Promises a subgraph can inline an external field on a specific return path. | Saves a full subgraph roundtrip—but only applies on the annotated field path, not globally. |
@override(from:, label:) |
Migrates field ownership between subgraphs progressively via percent(N). |
Always deploy additive resolver code first before bumping percentage; 0% gives instant rollback. |
@inaccessible |
Keeps a field in the composed supergraph for internal joins while hiding it from clients. | Ideal for staging new fields or hiding internal join keys without breaking supergraph satisfiability. |
@tag(name: "public") |
Attaches metadata tags used by Schema Contracts to filter Public vs. Internal graphs. | Pair with exclude_tags: ["internal"] so partner schemas never leak internal admin fields. |
@authenticated / @requiresScopes |
Enforces JWT presence and DNF scope rules ([["read:billing"]]) at the Router. |
Enforces coarse RBAC at the edge; still enforce row-level ABAC ownership inside subgraphs. |
Normalized query AST hashes reuse compiled DAGs in O(1); single-flight coalescing stops restart CPU stampedes.
Collects .load(key) calls inside one queueMicrotask() tick. Always instantiate per-request and align output by key map.
Independent _entities branches execute concurrently over HTTP/2 multiplexing; wall-clock time equals the slowest single branch.
The strictest subgraph always wins: one scope: PRIVATE Cart field forces private, no-store on the entire HTTP response.
Deduplicating identical (opHash, varsHash) watchers collapses viral hot-entity fan-out into 1 subgraph stream + 1 enrichment call.
Bounded per-client conflating ring buffers (cap 64) keep pod memory ≤ 6.0 GB even when 15% of mobile sockets stall.
Single-pass O(n) static AST guard rejects alias bombs and circular fragment loops in < 0.4 ms at 0% subgraph CPU.
Disable prod introspection, require build-time persisted query IDs, and verify SPIFFE mTLS certs + HMAC headers on every subgraph.
| SLO Metric | Production Target | Primary Mechanism |
|---|---|---|
| Partial Response Availability | 99.98% |
Nullable cross-subgraph edges + per-subgraph 250 ms circuit breakers |
| Global Surrogate-Key Purge | < 150 ms |
Granular Type:ID soft-purge + stale-while-revalidate |
| Subscription Fan-Out p99 | < 35 ms |
Kafka/NATS bridge + coalesced _entities enrichment + Tokio push |
| Schema Hot-Reload & Drain Drops | 0 ms / 0% |
Atomic Arc<Supergraph> swap + stateless HTTP Callback subscriptions |
| Layer | Production Systems | Operational Role |
|---|---|---|
| Federated Router | Apollo Router (Rust), WunderGraph Cosmo |
Compiled query planner, HTTP/2 multiplexing, 250K-WS termination, and atomic hot-reloads. |
| Schema Registry | Apollo GraphOS, GraphQL Hive |
CI composition gates, 14-day operation usage checks, @tag contracts, and immutable Uplink CDN. |
| Edge Cache & APQ | Fastly, Cloudflare Enterprise, Stellate |
Terminates APQ/Safelist GET traffic at global POPs with entity-level Surrogate-Key purges. |
| Security & AuthZ | Rhai / Coprocessors, OPA / Cedar, SPIFFE / SPIRE |
RS256 JWT validation, static AST cost limits, fine-grained ABAC, and mTLS subgraph identity. |
| Realtime & Events | HTTP Callback Protocol, Kafka, NATS, Redis Streams |
Stateless subgraph subscription callbacks, durable event fan-out, and cursor replay on reconnect. |
| Observability | OpenTelemetry, W3C traceparent, FTV1 |
Correlates per-field resolver flamegraphs, cache offload ratios, and client usage telemetry. |
graphql.gleee.in splits mastery into two deliberate halves: first build fast visual intuition for how GraphQL queries parse, batch, stitch, plan, and stream—then battle-test full distributed architectures under realistic production chaos drills.
Diagram-first mental models (~5 min/lab). Manipulate live AST trees, microtask DataLoader ticks, Query._entities payloads, Query Plan DAG waterfalls, and multipart/mixed chunks—backed by ~25 lines of pure TypeScript.
5-Act Engineering Playbooks: (I) Scale & Physics Math, (II) Wire & YAML Contracts, (III) 6-Node Interactive Simulator + Chaos Drills, (IV) Auto-Synced Zero-Dependency TypeScript, (V) Stack Mapping, Tradeoffs & SLOs.
| Schedule | Modules | Outcome |
|---|---|---|
| Week 1 · Core Mechanics | C1 → C2 → C3 → C4 → C5 |
Internalize AST projection, tick batching, Federation v2 directives, Query Plan DAGs, and incremental delivery. |
| Week 2 · Production Systems | S1 → S2 → S3 → S4 → S5 |
Design resilient Rust routers, zero-downtime schema registries, edge APQ caching, zero-trust security, and 250K-WS fan-out. |
| Shortcut | Action |
|---|---|
| / | Focus lab search bar |
| B | Open GraphQL & Federation Cheat Sheet modal |
| P | Open 2-Part Learning Playbook modal |
| T | Toggle Dark / Light theme across all gleee.in academies |
| Esc | Close active modal or clear search query |