fix(sushi): use parameterized GraphQL variables in findToken#1345
Open
jayantkamble10000 wants to merge 1 commit into
Open
fix(sushi): use parameterized GraphQL variables in findToken#1345jayantkamble10000 wants to merge 1 commit into
jayantkamble10000 wants to merge 1 commit into
Conversation
🟡 Heimdall Review Status
|
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.
c23db4e to
9ca61f3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
SushiDataActionProvider.findToken()builds its GraphQL request body by interpolating the user-providedargs.searchdirectly into the query string. This switches to a parameterized query using GraphQL variables (withJSON.stringifyfor the body).Why
Interpolating
searchinto the query string means special characters in the input can alter the GraphQL query structure rather than being treated purely as data —FindTokenSchemaonly enforcesz.string().min(2), so quotes, braces, and GraphQL keywords pass through unescaped. Using variables makes the input always a value, never query syntax, and removes the manual JSON escaping.Change
typescript/agentkit/src/action-providers/sushi/sushiDataActionProvider.ts— replace the string-interpolated body with aquery FindToken($chainId: Int!, $search: String!)document plusvariables: { chainId, search: args.search }. Behavior is unchanged for normal inputs and the returned shape is identical.