0

We need to rename the fields in the graphQL, so we get the AST of the GraphQL firstly, and modify it as we need. However, I can't find any solution to convert the AST back to the GraphQL.

The parser I use is "GraphQL Dotnet Parser"

Charlie
  • 2,141
  • 3
  • 19
  • 35

1 Answers1

0

There is a AstPrinter class that can print out the Document or any Ast Node.

https://github.com/graphql-dotnet/graphql-dotnet/blob/master/src/GraphQL/Utilities/AstPrinter.cs

AstPrinter.Print(…)

Joe McBride
  • 3,789
  • 2
  • 34
  • 38