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:
openhands 2026-02-23 22:30:55 +00:00
parent a321849ff6
commit 4e90411b15

View file

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