← All Tools

GraphQL Query Cost Calculator

Paste a GraphQL query and we'll walk the selection set to estimate cost, depth, and the total number of resolver calls a server might make. Useful for sizing rate limits, spotting N+1 traps, and budgeting expensive queries before clients hammer them.

Query

Sample:

Cost model

0
total cost
0
depth
0
selections
0
list fields

Per-field breakdown

How the cost is computed

We parse the query (operations, selection sets, fragments, arguments) and compute the cost recursively:

  • Every leaf field contributes the default field cost.
  • Every object field contributes its cost plus the cost of its selection set.
  • If a field has an argument from the argument-driven multiplier list (e.g. first: 50), its subtree cost is multiplied by that value.
  • Otherwise, list-shaped fields get the default list multiplier.
  • Inline fragments and named fragments inherit the parent multiplier.

This is the same shape as graphql-cost-analysis and Shopify's storefront cost rules: it's a worst-case upper bound, ideal for rate-limit sizing and spotting nested list bombs.

Tip. Drop a real production query in here and tweak the budget to mirror your server limits — you'll know in seconds whether a new client query is going to get throttled.