Class AstPrinter

java.lang.Object
graphql.language.AstPrinter
Direct Known Subclasses:
PrettyAstPrinter

@PublicApi public class AstPrinter extends Object
This can take graphql language AST and print it out as a string
  • Method Details

    • printAst

      public static String printAst(Node node)
      This will pretty print the AST node in graphql language format
      Parameters:
      node - the AST node to print
      Returns:
      the printed node in graphql language format
    • printAstTo

      public static void printAstTo(Node<?> node, Appendable appendable)
      This will pretty print the AST node in graphql language format to the given Appendable
      Parameters:
      node - the AST node to print
      appendable - the Appendable to write the output to
    • printAst

      public static void printAst(Writer writer, Node node)
      This will pretty print the AST node in graphql language format
      Parameters:
      writer - the place to put the output
      node - the AST node to print
    • printAstCompact

      public static String printAstCompact(Node node)
      This will print the Ast node in graphql language format in a compact manner, with no new lines and descriptions stripped out of the text.
      Parameters:
      node - the AST node to print
      Returns:
      the printed node in a compact graphql language format