The bucket
Each store has its own bucket of points, shared across all of the store’s API tokens:- Capacity — the maximum points available at once. Default 10,000.
- Restore rate — points added back each second. Default 500 / second.
The capacity and restore rate may change. Read your store’s live limits from
throttleStatus in each response (see below) rather
than hard-coding them.Query cost
Cost follows an object-reads model: it tracks how many objects (rows) a query materializes:
So paging a connection with
first: 50 costs roughly 50 × 10 = 500 points for
the nodes, plus their selected fields. Requesting fewer results — or fewer
fields, costs less. Some types carry a custom weight, and the total is rounded.
Requested vs. actual cost
- Requested cost is estimated from the query shape before it runs, using
your
firstvalues (an unpaged connection assumes a default page size). This is what’s reserved from your bucket up front. - Actual cost is computed from what actually came back: a null to-one costs
nothing. The difference (
requested − actual) is refunded to your bucket after execution.
Reading your limits
Every query response includes anextensions.cost object:
Use
currentlyAvailable and restoreRate to pace your requests.
Throttled responses
If a query’s requested cost exceeds the points currently available, it is rejected before it touches the database with HTTP429, a Retry-After
header (seconds to wait), and the error code THROTTLED:
Retry-After, then retry, ideally with a smaller
query.
Staying under the limit
- Read
throttleStatusafter each request and back off ascurrentlyAvailabledrops toward zero. - Handle
429/THROTTLEDby honoringRetry-After, with exponential backoff as a fallback. - Prefer several small paged requests over one large query. The unused-cost refund means narrow requests are cheap.
Related
- Queries & mutations: how operations are structured
- Pagination: paging through connections
- Errors: error shapes and codes