Skip to content

Commit

Permalink
fix(devx) replace graphQL nameserver example
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-tortora committed Nov 13, 2024
1 parent 2bc28b7 commit d6a8f02
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions docs/content/references/ts-sdk/typescript/graphql.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit d6a8f02

Please sign in to comment.