A highly customizable and versatile GraphQL client for React
const res = await toolkit.gql.query(query, variables).toPromise();
string
object
const query = ` query MyQuery($id: ID!) { transaction(id: $id) { id owner { address } fee { ar } } } `; const variables = { id: 'QJRUEcVHqNxVX5PNfzIpBSgWJlFwhQ3RmWdYEohrbwo', }; const res = await toolkit.gql.query(query, variables).toPromise(); console.log(res?.data);
{ "transaction": { "id": "QJRUEcVHqNxVX5PNfzIpBSgWJlFwhQ3RmWdYEohrbwo", "owner": { "address": "uk9eBF_jieshHtXfC9d1p81OHYJT8bTHazhfruLBCTA" }, "fee": { "ar": "0.000000000000" } } }
Was this page helpful?