/graphql on the same endpoint and auth token as JSON-RPC and gRPC. Use GraphQL for filtered, paginated reads — transactions by address, events by type, objects by owner and type — that have no gRPC equivalent. Each GraphQL request is 1 request unit (RU).
Endpoint and authentication
The GraphQL endpoint is your Sui Mainnet HTTPS endpoint with/graphql appended — YOUR_CHAINSTACK_ENDPOINT/graphql. To find your endpoint on Chainstack, see View node access and credentials.
Send each query as an HTTP POST with a JSON body of query and, optionally, variables. GET requests return 404, and the endpoint does not serve a GraphiQL IDE.
The endpoint accepts the same credentials as the node’s other interfaces:
A request without valid credentials returns
401. Responses carry Access-Control-Allow-Origin: *, so browser apps can call the endpoint directly. For every authentication option, see Authentication methods available on Chainstack.
GraphQL is available on Sui Mainnet only. Sui Testnet nodes do not serve /graphql.
Run a query
The official Sui TypeScript SDK (@mysten/sui) includes a GraphQL client, SuiGraphQLClient, that takes the endpoint as its url. The client runs raw queries and also exposes the same client.core methods as the SDK’s gRPC and JSON-RPC clients.
Filter transactions and events
Thetransactions and events queries take a filter argument, which is where GraphQL replaces JSON-RPC’s suix_queryTransactionBlocks and suix_queryEvents:
transactions— filter byaffectedAddress,sentAddress,affectedObject,function, orkind, and bound the range withafterCheckpoint,atCheckpoint, orbeforeCheckpointevents— filter bytype,module, orsender, with the same checkpoint bounds
OrderPlaced event from DeepBook v3:
first and after, or backward with last and before, and read the cursors from pageInfo. A page holds up to 50 items; requesting more fails with Page size is too large.
How far back GraphQL history goes
GraphQL history depends on the query type. Each kind of query reads from its own window, and the node reports every window throughserviceConfig.availableRange:
Query
availableRange for the current window of a specific query and filter. first is the oldest checkpoint the query can reach:
nodes, a transaction lookup returns null, and a checkpoint below the floor returns its sequenceNumber with every other field null. Check availableRange before you read an empty result as “no data”.
The windows move — the filtered window rolls forward with every checkpoint — so read availableRange at runtime instead of hard-coding checkpoint numbers. The gRPC interface on the same node reports the matching floor as lowestAvailableCheckpoint — see Checkpoint retention. For data older than these windows, query an archival service — see Sui’s Archival Store and Service.
Query limits
The node reports its query limits throughserviceConfig. A query over a limit fails with a GRAPHQL_VALIDATION_FAILED error that names the limit.
x-sui-rpc-show-usage: true header. The response then carries an extensions.usage object with the query’s node count, depth, and payload size in bytes.
Transactions and simulation
GraphQL also covers writes. TheexecuteTransaction mutation submits a signed transaction, and the simulateTransaction query dry-runs one, replacing JSON-RPC’s sui_dryRunTransactionBlock and sui_devInspectTransactionBlock. With the TypeScript SDK, call client.simulateTransaction() and client.signAndExecuteTransaction() on a SuiGraphQLClient the same way as on the gRPC client.
Streaming
The GraphQL endpoint does not accept WebSocket connections, so GraphQL subscriptions are not available. To stream new checkpoints, use gRPCSubscriptionService/SubscribeCheckpoints on the same node — see Sui tooling.
Billing
Each GraphQL request is 1 RU, the same as a gRPC or JSON-RPC call on Sui. Sui has no archive billing split, so a query that reaches back to the window floor costs the same as one at the tip. See Request units.Next steps
- Migrate Sui from JSON-RPC to gRPC and GraphQL — which JSON-RPC methods move to GraphQL and which to gRPC.
- Sui gRPC endpoint — gRPC on the same node, and checkpoint retention.
- Sui tooling — SDKs and per-language connection code.
- GraphQL for Sui RPC — Sui’s own GraphQL guide and schema reference.