Execute a GraphQL query against the Sui blockchain endpoint.
This is the low-level function used by all other GraphQL helper functions. Use this when you need to execute custom queries not covered by the helper functions.
The expected response data type
The GraphQL query string
Variables to pass to the query
Promise resolving to the GraphQL response
If the HTTP request fails
const result = await executeGraphQLQuery<MyResponseType>( `query GetObject($address: SuiAddress!) { object(address: $address) { asMoveObject { contents { json } } } }`, { address: "0x123..." });console.log(result.data?.object?.asMoveObject?.contents?.json); Copy
const result = await executeGraphQLQuery<MyResponseType>( `query GetObject($address: SuiAddress!) { object(address: $address) { asMoveObject { contents { json } } } }`, { address: "0x123..." });console.log(result.data?.object?.asMoveObject?.contents?.json);
Execute a GraphQL query against the Sui blockchain endpoint.
This is the low-level function used by all other GraphQL helper functions. Use this when you need to execute custom queries not covered by the helper functions.