We’re happy to announce the launch of a Beta version of the Sui GraphQL RPC service, as part of our ongoing efforts to provide the best web3 infrastructure and developer experience.
This Beta version of the Sui GraphQL RPC service is a READ-ONLY service consisting of a snapshot of Sui mainnet
,
which has data available up to epoch 196
and checkpoint 16564261
. Please note that the mainnet
data is frozen and it will not be updated. A testnet
service is planned for a later date and we will update this post when it gets launched.
Getting Started
Go to https://graphql-beta.mainnet.sui.io and try the new API out. The online IDE provides an interactive experience by offering auto-completion (use Ctrl+Space) and in-built documentation. The Sui repository has documented examples that are generated from GraphQL query files that you can reuse. Note that any addresses or object IDs in the examples correspond to the mainnet
data.
You can find the GraphQL schema by querying the /schema
endpoint (e.g., https://graphql-beta.mainnet.sui.io/schema) or using the playground IDE.
Upcoming RPC 2.0
If you’re interested in the technical details, the timelines around RPC 2.0, the overall architecture and why a new RPC, check out this GitHub Issue: RPC 2.0 · Issue #13700 · MystenLabs/sui · GitHub
Feedback
We welcome feedback that you have, particularly about the schema, so please post it in this thread!
Disclaimer & Limitations
Please note that this service is offered as is, without a SLA, and it is not intended nor recommended for production ready applications. Its main purpose is to allow developers to discover the offerings of the upcoming RPC 2.0 service.
The endpoint is rate-limited to avoid congestion and misuse (this service is not intended for production) and it does have some limits on the complexity of the queries one can make. Please use this query to find the current rate limits on the GraphQL queries:
query {
serviceConfig {
maxQueryDepth
maxQueryNodes
maxDbQueryCost
maxQueryVariables
maxQueryFragments
requestTimeoutMs
}
}
By default, there is a query timeout of 40s. If the time limit is exceeded, the query is stopped and an error is returned.
As this is only a beta version, there are a few unsupported features and/or limitations:
- There are no performance optimizations, thus some queries may be slower than expected
- Subscriptions are not supported
- Executing transactions and other information on-chain is not possible - the beta release is a READ-ONLY service
- Queries requesting stake related information might be a bit slower or fail the first time, depending on an internal cache. If it fails, try again after a couple of minutes.
The following parts of the draft schema are are not available at the time of writing (2023-10-31), either because they are under development or out of scope for this beta. For a list of supported features, please consult the documentation in the online IDE:
Top-level
Query.availableRange
Query.coinMetadata
TransactionBlock
kind
is missing structured data for certain kinds of transaction
TransactionBlockEffects
objectReads
ObjectOwner
Object Owner refers to any type (Address
, Owner
, Object
) that could own other objects. The following fields are not supported on these types:
nameServiceConnection
dynamicField
dynamicFieldConnection
Validator
apy
Filters
All filters do not support combination (any
, all
, not
) filters, and the following specific filters are to be implemented:
ObjectFilter
: Filtering by package, module and type, and filtering by object key (ID and version).EventFilter
: Filtering by event package, module or type.TransactionBlockFilter
: Filtering by the address that paid for the transaction, the start or end time.
Executing Transactions
Execution is unsupported and out of scope for this beta.
Query.dryRunTransactionBlock
Mutation.executeTransactionBlock
Subscriptions
Subscription APIs are unsupported and out of scope for this beta.
Subscription.events
Subscription.transactions