Score subgraph query depth API
Walk object-type references in the supplied SDL, starting at Query when that type is present. Scalars are ignored and a repeated type is not walked again. The index is that depth. The risk score rises when the depth passes the supplied limit, and when introspection is enabled. No router is contacted.
The Score subgraph query depth operation is part of the Federation Authorization Audit API on BRAINIAC.software. Walk object-type references in the supplied SDL, starting at Query when that type is present. Scalars are ignored and a repeated type is not walked again. The index is that depth. The risk score rises when the depth passes the supplied limit, and when introspection is enabled. No router is contacted. It is exposed as POST /api/v1/graphql-security/subgraph-complexity and priced at $0.04 USDC on Base. Payment uses the x402 exact scheme: an unpaid call returns HTTP 402 with payment requirements; after paying the exact USDC amount, retry the same request with a payment-signature header and Idempotency-Key. No account and no API key are required. Data sources for this product: Caller-supplied GraphQL subgraph SDL processed locally Caller-supplied GraphQL Federation deployment configuration processed locally Limitations: Schemas are the SDL strings in the request. No gateway, router, or subgraph is contacted. A difference between directives is a schema-level inconsistency. It does not show that a request would be allowed or denied at runtime. Known authorization directives are @authenticated, @requiresScopes, and @policy. Another directive is used only when the request supplies its semantics. The supergraph SDL is compared as supplied text. Federation composition is not executed. Deployment exposure is read from explicit labels in the request. URLs are not resolved or probed. field-authorization-coverage counts fields whose line contains a supplied directive. It does not decide whether a request would be allowed. subgraph-complexity walks type references in the supplied SDL. The index is that depth, and introspection adds risk only when the request says it is enabled. Outputs are compliance prechecks, drafts, or data lookups for human review. They are not official determinations, legal advice, identity confirmation, or certified filings. Related operations in this group include Audit federation authorization, Score field authorization coverage, Audit federation subgraph exposure. Open the group documentation for the full request schema, field notes, and response examples before integrating.
/api/v1/graphql-security/subgraph-complexityExample request
curl -i -X POST "https://www.brainiac.software/api/v1/graphql-security/subgraph-complexity" \
-H 'content-type: application/json' \
-H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
--data-binary @- <<'JSON'
{
"sdl": "type Query {\n user: User\n}\ntype User {\n posts: [Post]\n}\ntype Post {\n author: User\n title: String\n}",
"max_depth": 1,
"introspection": "enabled"
}
JSONAn unpaid probe returns HTTP 402 with x402 payment requirements. After paying the exact USDC amount on Base, retry the identical request with a payment-signature header.
FAQ
- Do I need an API key? No. Pay the listed USDC amount with x402.
- What network? Base (eip155:8453), USDC.
- Is this an official determination? No. Results are for human review against the cited sources.
Related operations
- Audit federation authorization — $0.05 USDC
- Score field authorization coverage — $0.04 USDC
- Audit federation subgraph exposure — $0.05 USDC