'How to generate GraphQL query string from its AST definition

Is there a way to generate GraphQL query string from the AST definitions? Currently need to fetch specific query from the AST according to its definitions.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source