GraphQL API
Auto-generated from your TOML config. Every table gets a query endpoint.
Endpoints
Enable the API with [api] port in TOML or --api-port on the CLI.
| Path | Description |
|---|---|
| / | GraphiQL IDE |
| /graphql | GraphQL endpoint |
| /health | Liveness probe |
| /ready | Readiness (503 during backfill) |
| /metrics | Prometheus metrics |
Filter operators
Every column on every table supports these operators in the where clause:
| Suffix | Meaning |
|---|---|
| _eq | Equal (default when no suffix) |
| _ne | Not equal |
| _gt | Greater than |
| _gte | Greater than or equal |
| _lt | Less than |
| _lte | Less than or equal |
| _in | In array |
| _not_in | Not in array |
| _contains | String contains |
| _starts_with | String starts with |
Filter composition
Combine filters with AND and OR for complex queries.
graphql
{
usdc_transfers(
where: {
OR: [
{ from_address: "0xAbc..." }
{ to_address: "0xAbc..." }
]
value_gte: "1000000000"
}
orderBy: block_number
orderDirection: desc
first: 50
) {
block_number
tx_hash
from_address
to_address
value
block_timestamp
}
}Filters at the same level in where are combined with AND by default.
Pagination
Two pagination modes:
Cursor-based
graphql
{
usdc_transfers(first: 100, after: "eyJpZCI6MTAwfQ==") {
block_number
tx_hash
}
}Use first and after with the cursor returned from the previous page. Best for large datasets and infinite scroll.
Offset-based
graphql
{
usdc_transfers(first: 50, skip: 100) {
block_number
tx_hash
}
}Use first and skip for simple page-based navigation.
Sorting
graphql
{
usdc_transfers(
orderBy: block_number
orderDirection: desc
first: 10
) {
block_number
value
}
}orderBy accepts any column name. orderDirection is asc or desc.