Skip to main content

GraphQL samples

The query documents under chains/sui/samples/graphql/ are designed for the Sui GraphQL RPC endpoint.

curl -sS "$SUI_GRAPHQL_ENDPOINT" -H 'content-type: application/json' --data-binary @<(jq -n --rawfile query chains/sui/samples/graphql/object-query.graphql --arg objectId '0x...' '{query:$query, variables:{objectId:$objectId}}')

Query groups

FileUse case
object-query.graphqlRead object owner, version, digest, type, and content.
transaction-query.graphqlInspect a transaction by digest with effects and checkpoint.
event-query.graphqlQuery Move events by sender/package/module/type filters.
pagination.graphqlPage through objects or transactions with cursors.
tip

Use GraphQL for UI and analytics reads where field selection and pagination matter more than the lowest possible latency.