GraphQL
Erigon implements the Ethereum GraphQL interface originally introduced in EIP-1767. The schema is maintained in the ethereum/execution-apis repository, kept in sync with client implementations such as Geth and Besu. Erigon follows that schema.
Enabling GraphQL
GraphQL is disabled by default. Enable it with the --graphql flag:
./erigon --graphql
GraphQL shares the same port as the HTTP JSON-RPC server (default 8545). It does not use --http.api — --graphql is its own toggle.
Endpoints
| Endpoint | Purpose |
|---|---|
http://localhost:8545/graphql | GraphQL API endpoint |
http://localhost:8545/graphql/ui | GraphiQL browser UI for interactive queries |
Schema Reference
Erigon follows the GraphQL schema maintained in ethereum/execution-apis, which is kept in sync with major clients such as Geth and Besu. For human-readable field descriptions and query examples, the Geth GraphQL reference is a useful companion.
The schema includes queries for blocks, transactions, accounts, logs, and pending state, as well as the sendRawTransaction mutation.
Pending calls
The GraphQL call field does not support execution against a pending block. Erigon returns pending state is not supported because it cannot currently acquire a pending block header and matching state in one view. Other pending-state fields keep their existing behavior.
Example Query
{
block(number: 21000000) {
hash
number
timestamp
transactions {
hash
from { address }
to { address }
value
}
}
}
curl -X POST http://localhost:8545/graphql \
-H "Content-Type: application/json" \
-d '{"query": "{ block(number: 21000000) { hash number } }"}'