graphql-complexity-limit-tester
БесплатноБез исполняемых скриптовНе проверенUse when a GraphQL API must be hardened or audited against denial of service and schema disclosure. Sends over-limit depth and cost queries and asserts they…
от testland★ 18 звёзд на GitHubОб этом скилле
graphql-complexity-limit-tester
Overview
The introspection attack-surface catalog (references/introspection.md) names query-depth limiting and query-cost limiting as key DoS mitigations, but nothing in that catalog executes a test. This skill closes that gap: it authors tests that send an over-limit query and assert a validation error is returned before any resolver runs. The strongest request-layer mitigation - persisted-query allowlisting - is cataloged in references/persisted-queries.md.
Three library families are covered:
graphql-depth-limit(npm:graphql-depth-limit, canonical repogithub.com/stems/graphql-depth-limit, per npm registry registry.npmjs.org/graphql-depth-limit)depthLimit(n)validation rule, drop-in for Apollo or express-graphql.
graphql-cost-analysis(npm:graphql-cost-analysis, repogithub.com/pa-bru/graphql-cost-analysis, per github.com/pa-bru/graphql-cost-analysis)costAnalysis({ maximumCost })validation rule; queries above the threshold are rejected.
@escape.tech/graphql-armor(repogithub.com/Escape-Technologies/graphql-armor, docs escape.tech/graphql-armor/docs)max-depthplugin: defaultn = 6(per escape.tech/graphql-armor/docs/plugins/max-depth)cost-limitplugin: defaultmaxCost = 5000(per escape.tech/graphql-armor/docs/plugins/cost-limit)max-tokensplugin: defaultn = 1000(per escape.tech/graphql-armor/docs/plugins/max-tokens)
Differentiation vs. apollo-server-tests: that skill covers resolver
correctness + production-config gates (introspection, APQ,
hideSchemaDetails). This skill is scoped exclusively to depth/complexity
DoS tests - over-limit query construction, validation-layer rejection
assertion, and the cross-library matrix.
Hard stop: no limit configured
If the server under test has no depth or complexity limit configured at
all (no depthLimit/costAnalysis validation rule, no
ApolloArmor/EnvelopArmorPlugin installed), halt immediately:
HALT: no depth/complexity limit configured.
Tests would pass vacuously - no enforcement exists to verify.
Install graphql-depth-limit, graphql-cost-analysis, or
@escape.tech/graphql-armor first, then re-run this skill.
Do not write tests that assert on a server with no limit - they will produce false positives.
Step 1 - Install
Choose the library that matches the project.
# graphql-depth-limit (express-graphql / Apollo standalone rule)
npm install --save-dev graphql-depth-limit
# graphql-cost-analysis (Apollo standalone rule)
npm install --save-dev graphql-cost-analysis
# graphql-armor (Apollo or Envelop/Yoga - bundles all plugins)
npm install --save @escape.tech/graphql-armor
Step 2 - Identify the configured limit
Read the server setup to find the active limit value before crafting queries. Common locations:
| Library | Where the limit lives |
|---|---|
graphql-depth-limit |
depthLimit(N) in validationRules array |
graphql-cost-analysis |
costAnalysis({ maximumCost: N }) in validationRules |
graphql-armor max-depth |
armor.protect() or new ApolloArmor({ maxDepth: { n: N } }) |
graphql-armor cost-limit |
new ApolloArmor({ costLimit: { maxCost: N } }) |
If the limit is not explicit, use the library default: n = 6 for
graphql-armor max-depth (per
escape.tech/graphql-armor/docs/plugins/max-depth),
maxCost = 5000 for graphql-armor cost-limit (per
escape.tech/graphql-armor/docs/plugins/cost-limit).
Step 3 - Craft over-limit queries
Depth query
Build a query whose nesting depth is configuredLimit + 1. If the
schema is User { friends: [User] } and the depth limit is 5:
query DepthBust {
user { # depth 1
friends { # depth 2
friends { # depth 3
friends { # depth 4
friends { # depth 5
friends { id } # depth 6 -> over limit
}
}
}
}
}
}
For schemas without recursive types, chain any nested relationship until the depth exceeds the limit.
Cost/complexity query
For graphql-cost-analysis, assign costs via the schema directive
@cost(complexity: N) or via costMap. To construct an over-limit
query without schema changes, use a fan-out pattern whose calculated
cost exceeds maximumCost. Per
github.com/pa-bru/graphql-cost-analysis,
defaultCost applie
Установить graphql-complexity-limit-tester в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл graphql-complexity-limit-tester?
Use when a GraphQL API must be hardened or audited against denial of service and schema disclosure. Sends over-limit depth and cost queries and asserts they are rejected, proving graphql-depth-limit, cost analysis or graphql-armor are enforced; covers introspection and persisted-query allowlists.
Как установить скилл graphql-complexity-limit-tester?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл graphql-complexity-limit-tester запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic