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 |
Access Control
/graphql passes the same checks as the JSON-RPC endpoint on that port (the /graphql/ui page itself is served without them, but the queries it sends go to /graphql):
--http.vhosts(defaultlocalhost): a request whoseHostheader names a host that is not listed gets403. Requests addressed by IP are served. If you expose GraphQL under a hostname, for example behind a reverse proxy, add that hostname to--http.vhosts.--http.corsdomain: a browser page on another origin is served only if its origin is listed.--rpc.max.concurrency: GraphQL requests are subject to the same admission limit, enforced separately from the JSON-RPC endpoint, and request bodies are capped at 32 MiB.
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 } }"}'