Builders can query Sui data and keep receiving matching checkpoints, transactions, and events through the same GraphQL interface.

Main Takeaways

  • GraphQL on Sui now delivers checkpoints, transactions, and events as they happen, with filtering aligned to what's already available for queries.
  • A subscription can start from a cursor in the past, backfill to the present, and continue into live delivery. Clients that disconnect reconnect and backfill from where they left off.
  • Sui provides real-time data through both gRPC and GraphQL. Builders pick the interface that fits their stack.

Agents and applications do more than look up blockchain data. They react as transactions happen: a wallet shows a payment, a trading application updates a position, a monitoring service flags unusual activity.

Until now, developers using GraphQL on Sui could query that data but had to keep asking whether it had changed. With GraphQL Subscriptions, an application describes the activity it cares about and receives matching updates as they occur.

Developers can subscribe to checkpoints, transactions, and events. Transaction and event subscriptions use filtering aligned with GraphQL queries, so an application can find historical data and follow new activity through one interface. The fields available through the Query schema are available in subscriptions as well, with limited exceptions.

Query, catch up, stay current

Suppose an application needs to follow events from a particular package. It queries the events it needs, then keeps receiving matching events as new ones occur.

A subscription does not have to start from now. It can start from a cursor in the past, replay matching transactions or events to the present, and continue into live delivery as one continuous, ordered stream. If a client disconnects, it reconnects with its last-seen cursor and the subscription backfills what it missed before resuming live. The service recovers its own gaps too: if its upstream checkpoint connection is interrupted, it recovers the missed checkpoints so subscribers see a contiguous feed.

That continuity applies across wallets, explorers, trading applications, analytics tools, monitoring systems, automation services, and AI agents, anything that reacts to onchain activity without polling for it.

‍

GraphQL Subscriptions and gRPC subscriptions

Sui already provides real-time subscriptions through gRPC. Both interfaces now deliver filtered, live streams of Sui activity, and are built to serve different needs.

gRPC is Sui's lower-level, strongly typed interface. It's the natural choice for high-performance backends, exchanges, infrastructure, and large indexing systems. GraphQL Subscriptions expose that same activity through GraphQL, so developers can select the fields and related data their application needs using the types and filters they already use for queries.

Lighter-weight custom indexing

GraphQL Subscriptions give teams working in TypeScript, Python, and other widely used programming languages a simpler path to application-specific indexing. A developer can subscribe to the transactions or events relevant to their application and write those results into their own database or pipeline. A team tracking activity from its own contracts now doesn't necessarily need to adopt the Rust-based custom indexing framework to keep a live view of that data.

This doesn't replace the custom indexing framework though. That framework remains the right option for purpose-built pipelines with their own storage and processing logic, and more sophisticated indexing workloads still benefit from it.

How the pieces fit

GraphQL Subscriptions aren't a parallel data stack. For live data, the GraphQL service consumes Sui's gRPC checkpoint stream. For historical catch-up and data resolution, it uses the gRPC Ledger Service, which can point at an archival instance when full history is required.

Sui → gRPC + Archival → GraphQL → application

GraphQL Subscriptions are available on both Testnet and Mainnet. Explore the GraphQL Subscriptions documentation to get started.

‍

Author

Sui Foundation

High-performance blockchain delivering the full stack for a new global economy.

Read more like this

Tokenized Gold Now Live on Sui Amid Institutional Surge

Matrixdock’s flagship XAUm asset natively launches on Sui as RWA use cases continue to expand.

2min read
Sui Foundation

SUI Now Listed on Robinhood, Expanding its Reach to Millions of Users

The SUI token is available to trade for US customers on Robinhood starting today, in landmark moment of maturation and access for the Sui ecosystem.

1min read
Sui Foundation

All About AI Agents

AI agents are transforming Web3, and Sui is powering their next evolution.

3min read
Abhinav Garg

Libre Capital Makes its Investment Funds Available to Sui Users

Through the Libre Capital Gateway on Sui, institutional or accredited investors will be able to invest in the company's funds.

2min read
Sui Foundation

Sam Blackshear on the Origins of Move

Mysten Labs CTO and inventor of the Move programming language discusses the motivation behind developing it.

1min read
Sam Blackshear

Sui Stack Messaging SDK: Programmable Communication for Web3

Build private, programmable communication directly into your app with the new Sui Stack Messaging SDK.

3min read
Sui Foundation