Query cost
Use this API to calculate the price of your query
Last updated
Use this API to calculate the price of your query
Last updated
We have implemented static query cost analyses, based on GraphQL schema types and fields.
Total query cost is calculated from summarizing all resolver costs plus all fields costs from those resolver result set. If the field is of an array type, the total cost of the field is multiplied by numerator - limit, after or before parameters of the query. If none is specified, then default value = 50 is used.
Almost all scalar types (i.e. Int, String, bool) have the same cost, but there are exceptions for big strings, as account.boc, block.boc, etc.
You can observe gql schema for types and fields costs:
Type any query in the playground, and add cost
api call above, so that it will show you the cost of your query. Use tryRun
parameter to see the cost, without query execution.
Result: