fix: \WalletCard.vue\ GraphQL variables (#191)
Refactor address interpolation in fetchWalletData to use a proper GraphQL variables object instead of embedding the address directly in the query string template literal. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a321849ff6
commit
4e90411b15
1 changed files with 3 additions and 2 deletions
|
|
@ -21,8 +21,8 @@ async function fetchWalletData(addr: string) {
|
|||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
query: `{
|
||||
holders(address: "${addr.toLowerCase()}") {
|
||||
query: `query WalletData($address: String!) {
|
||||
holders(address: $address) {
|
||||
balance
|
||||
totalEthSpent
|
||||
totalTokensAcquired
|
||||
|
|
@ -31,6 +31,7 @@ async function fetchWalletData(addr: string) {
|
|||
items { currentPriceWei }
|
||||
}
|
||||
}`,
|
||||
variables: { address: addr.toLowerCase() },
|
||||
}),
|
||||
});
|
||||
const json = await res.json();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue