Getting started
Query cost and limits
How Ostorya prices a query, and the limits.
Like Shopify, Ostorya computes a cost for every query before running it, and refuses queries over the limit.
| Selection | Cost |
|---|---|
| Scalar or enum field | 0 |
| Object field | 1 + its children |
Connection (first/last) | 2 + first × (cost of one node) |
| Mutation | +10 |
- Maximum cost of one query: 1000.
- Maximum page size:
first/last≤ 250. - Every response reports the cost in
extensions.cost.requestedQueryCost(andmaximumAvailable).
{
"data": { … },
"extensions": { "cost": { "requestedQueryCost": 312, "maximumAvailable": 1000 } }
}To stay under the limit, ask for fewer nodes per page and fewer nested connections. For example, 100 products each with their variants (first: 100) costs far more than 100 products with only their first variant.