GraphQL depth and field cost
Estimate selection depth and field count for a GraphQL query.
Loading the tool…
What it does, how to use it, and questions
What it does
Deep GraphQL selections can amplify server work. A simple depth and field count is a first filter before schema-aware cost analysis.
This heuristic strips comments and strings, then measures selection set nesting and field identifiers. It is not Apollo’s cost model.
How to use it
- Paste a query or mutation.
- Read max depth and field count.
- Tighten the query if depth is surprising.
Things to watch for
- Fragments and directives are counted simply; aliases may double-count intent.
- Without a schema, list sizes are unknown.
Questions
- Is this schema-aware?
- No. It only looks at the query text.
- Does it execute the query?
- No.
- What is depth?
- How many nested selection sets deep the deepest field is.
- Is the query uploaded?
- No.