@cost weights multiplied by @listSize fan-out evaluated pre-execution before touching any subgraph.
Defeat single-request DoS amplification before execution with O(n) static AST depth, alias, and @cost/@listSize guards, while propagating cryptographically signed zero-trust identity over mTLS across federated subgraphs.
@cost weights multiplied by @listSize fan-out evaluated pre-execution before touching any subgraph.
Single-pass AST validation kills circular fragment depth bombs and 100-alias amplification floods at 0% subgraph CPU.
Mutual TLS client certificates plus signed X-Router-Sig headers defeat forged X-Auth-* direct subgraph bypasses.
Cached RS256 JWKS verification and compiled @requiresScopes directive checks add sub-millisecond router latency.
@requiresScopes → mTLS+HMAC stops every attack class before downstream databases ever see a query.
0% Subgraph CPU on Rejected Queries
| Security Primitive | Production Standard | Operational Role |
|---|---|---|
| Router Policy & Header Signing | Apollo Router Rhai / Coprocessor |
Validates RS256 JWKS, injects X-Auth-Subject/X-Auth-Scopes, and attaches HMAC X-Router-Sig. |
| Static Complexity & Cost Engine | GraphQL Cost Spec (@cost / @listSize) |
Computes worst-case pre-execution query cost from schema weights and slicing arguments before fan-out. |
| Fine-Grained ABAC / Policy Engine | OPA (Open Policy Agent) / AWS Cedar |
Evaluates resource-ownership and @policy(policies: [["pii_clearance"]]) rules in sub-millisecond sidecars. |
| Subgraph Zero-Trust Identity | SPIFFE / SPIRE / Istio mTLS |
Issues short-lived workload certs (spiffe://gleee.in/ns/prod/sa/router) blocking direct subgraph bypasses. |
| Arbitrary Query Elimination | Persisted Query Safelist (PQ) |
Allows only build-time registered SHA-256 operation IDs in production, shrinking DoS attack surface to zero. |
| Edge Perimeter & Volumetric Guard | Envoy / Cloudflare Edge WAF |
Enforces IP/tenant token-bucket rate limits, payload size caps, and disables GraphQL introspection at the edge. |
Rejects expensive queries in < 0.4 ms before any subgraph or database connection is touched—0% downstream CPU waste.
Zero schema annotation effort, but malicious queries still burn DB locks and CPU for 5–10s until the timeout fires.
@requiresScopes vs. Subgraph ABACRouter blocks missing JWT scopes (read:billing) at the edge in 0.3 ms; Subgraph enforces row-level ownership (invoice.ownerId === sub).
Centralizes ownership checks in one place, but forces unnecessary network fan-out to subgraphs for blatantly unauthorized callers.
Only CI-audited, cost-approved operation hashes execute in prod—completely neutralizing ad-hoc alias and depth bombs.
Required for external developer APIs (like GitHub/Shopify), but demands strict depth, alias, cost, and per-token cost-bucket throttling.
Preserves public profile fields while setting unauthorized nullable fields (billing: null) + UNAUTHORIZED_FIELD_OR_TYPE error.
Aborts the entire HTTP request immediately before execution—cleanest for security audits and prevents partial timing side-channels.