Skip to content

Commit f0e39d3

Browse files
authored
docs(graphql): add docs for allocations query (#404)
1 parent d6fff73 commit f0e39d3

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

graphql/allocations.query.graphql

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
# AllocationsQuery
2+
#
3+
# This query retrieves allocations for a specified indexer in The Graph's Indexer TAP system.
4+
#
5+
# Input Variables:
6+
# - $indexer (ID!): The unique identifier of the Indexer whose allocations are being queried.
7+
# - $closedAtThreshold (Int!): The threshold timestamp used to filter closed allocations.
8+
# - $block (Block_height): The block height at which to query allocations (optional).
9+
# - $first (Int!): The maximum number of allocations to return (used for pagination).
10+
# - $last (ID!): The ID of the last allocation from a previous query (used for pagination).
11+
#
12+
# Query Logic:
13+
# - Fetches block metadata (number, hash, timestamp) using the provided `$block` height.
14+
# - Retrieves allocations filtered by:
15+
# - Allocations with `id > $last` (for pagination).
16+
# - Allocations where the indexer has the provided `$indexer` ID.
17+
# - Allocations that are either `Active`, or `Closed` but closed after `$closedAtThreshold`.
18+
# - Results are sorted by `id` in ascending order and limited to `$first` number of entries.
19+
#
20+
# Fragment: AllocationFragment
21+
# - Returns detailed information about each allocation, including:
22+
# - Allocation ID.
23+
# - Indexer ID.
24+
# - Number of allocated tokens.
25+
# - Block and epoch when the allocation was created.
26+
# - Epoch when the allocation was closed.
27+
# - Subgraph deployment ID and denial status.
28+
#
29+
# Example Use Case:
30+
# This query helps Indexers monitor their allocations, filter out inactive or irrelevant allocations,
31+
# and retrieve allocation data for specific block heights or timeframes.
32+
133
query AllocationsQuery(
234
$indexer: ID!,
335
$closedAtThreshold: Int!,

0 commit comments

Comments
 (0)