GraphQL Query Complexity Estimator

Score a GraphQL query by field depth and list size.

Runs in your browser. Nothing is uploaded — your input is processed on this device and discarded when you close the tab.

GraphQL Query Complexity Estimator

How to use this tool

  1. Paste a GraphQL query. Operations, fragments and plain selection sets are all accepted.
  2. Read the score. Each field costs its depth (top-level fields cost 1, their children 2, and so on), multiplied by its list size when it carries a first or last argument, capped at 10 per field.
  3. Use the table. The per-field breakdown shows exactly which field drives the total, so you can trim the expensive one.

Worked example

Paste the sample query { user { name posts(first: 5) { title } } }. The total is 16: user costs 1, name costs 2, posts costs 2 × 5 = 10, and title costs 3. There are 4 fields, the maximum depth is 3, and 1 field is a list field.

What this tool does not do / Limits

This is a planning number from the rule stated on this page, not a limit enforced by any server, and different APIs score queries differently. Fragment spreads are counted as one field each and are not expanded into the fields they contain. Directives such as @include and @skip do not change the score.

Frequently asked questions

Why does a list field cost so much more?

Because a list can return many objects, each with its own subfields. The first or last argument is the honest size signal, capped at 10 here so one huge page cannot hide everything else.

Is a score of 16 good or bad?

There is no universal pass mark. Compare queries against each other and against whatever limit your own API sets; this tool only makes the comparison visible.

Related tools