@evefrontier/dapp-kit - v0.0.1
    Preparing search index...

    Function executeGraphQLQuery

    • 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.

      Type Parameters

      • T = unknown

        The expected response data type

      Parameters

      • query: string

        The GraphQL query string

      • variables: Record<string, unknown>

        Variables to pass to the query

      Returns Promise<GraphQLResponse<T>>

      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);