---
name: "graphql-depth-limiting-armor"
description: "Protect GraphQL APIs against denial-of-service via nested query depth and cost limits."
metadata:
  author: "Escape Technologies"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "limit graphql query depth"
  - "prevent nested query dos graphql"
  - "add graphql armor"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# GraphQL Query Depth Limiting & Cost Analysis Armor

Defends GraphQL endpoints against malicious nested queries using graphql-depth-limit and graphql-cost-analysis: calculating query complexity, rejecting circular nesting, and rate limiting by cost.

## When to Invoke
Invoke this skill whenever you need to:
- limit graphql query depth
- prevent nested query dos graphql
- add graphql armor

## Execution SOP & Rules
1. Apply depth limiting validation rules to reject excessively deep queries (max depth: 5-7).
2. Enforce query cost analysis to cap maximum computational points per incoming request.
3. Disable introspection and schema explorer interfaces in production environments.
4. Set request timeouts on GraphQL resolvers to terminate runaway database queries.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
