From 9ca61f31031e46705b7850783d62fc172ae58b34 Mon Sep 17 00:00:00 2001 From: Jayant Kamble Date: Sat, 27 Jun 2026 11:22:47 +0530 Subject: [PATCH] fix(sushi): use parameterized GraphQL variables in findToken Build the find-token request with a parameterized GraphQL query and variables instead of interpolating args.search into the query string. This treats the input as data rather than query syntax and removes the manual JSON escaping. No change to the returned result shape. --- .../sushi/sushiDataActionProvider.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/typescript/agentkit/src/action-providers/sushi/sushiDataActionProvider.ts b/typescript/agentkit/src/action-providers/sushi/sushiDataActionProvider.ts index 73fab69fa..675c21e86 100644 --- a/typescript/agentkit/src/action-providers/sushi/sushiDataActionProvider.ts +++ b/typescript/agentkit/src/action-providers/sushi/sushiDataActionProvider.ts @@ -56,7 +56,17 @@ Important notes: "Content-Type": "application/json", Accept: "application/json", }, - body: `{"query":"query { tokenList(chainId: ${chainId}, first: 10, search: \\"${args.search}\\") { address symbol name decimals } }"}`, + body: JSON.stringify({ + query: `query FindToken($chainId: Int!, $search: String!) { + tokenList(chainId: $chainId, first: 10, search: $search) { + address + symbol + name + decimals + } +}`, + variables: { chainId, search: args.search }, + }), }); const response = await request.json();