Skip to content

Trying to find an example of how to modify the AST #856

@dejang

Description

@dejang

First of all I apologize if this issue was opened in the wrong section.

I am trying out the parser in a small scale personal project in which I'd like to make some changes to the initial query. For the sake of keeping things simple let's assume I am trying to replace all occurrences of string values "John" to "John Smith" in the user provided query for all query arguments.

While looking through the opened issues I found an inspiration for a Visitor module which I could use to parse the AST nicely. Kudos to the owner of that issue for putting it up.

However, mutating the AST with or without such a module is still something I'm confused about. Would it possible to provide an example of how to alter the AST using the simple scenario in the first paragraph?

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions