From d6a8f020214994b73b056342cbecfc8687a7784d Mon Sep 17 00:00:00 2001 From: Lucas Tortora Date: Wed, 13 Nov 2024 13:00:36 -0300 Subject: [PATCH] fix(devx) replace graphQL nameserver example --- .../references/ts-sdk/typescript/graphql.mdx | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/content/references/ts-sdk/typescript/graphql.mdx b/docs/content/references/ts-sdk/typescript/graphql.mdx index 2e4914475b0..6aae5cdac25 100644 --- a/docs/content/references/ts-sdk/typescript/graphql.mdx +++ b/docs/content/references/ts-sdk/typescript/graphql.mdx @@ -50,17 +50,32 @@ The `graphql` also detects variables used by your query, and will ensure that th to your query are properly typed. ```typescript -const getIotansName = graphql(` - query getIotaName($address: IotaAddress!) { - address(address: $address) { - defaultIotansName +const queryTransactionBalanceChanges = graphql(` + query ($address: IOTAAddress!) { + transactionBlocks(filter: { + function: "0x3::iota_system::request_add_stake" + signAddress: $address + }) { + nodes { + digest + effects { + balanceChanges { + nodes { + owner { + address + } + amount + } + } + } + } } } `); -async function getDefaultIotansName(address: string) { +async function getTransactionBalanceChanges(address: string) { const result = await gqlClient.query({ - query: getIotansName, + query: queryTransactionBalanceChanges, variables: { address, },