pretty_graphql is a configurable GraphQL formatter.
Basic Usage
You can format source code string by using [format_text] function.
use ;
let options = default;
assert_eq!;
For detailed documentation of configuration, please read configuration documentation.
If there're syntax errors in source code, it will return Err:
use ;
let options = default;
assert!;
Print Syntax Tree
If you have already parsed the syntax tree from apollo-parser,
you can use [print_tree] to print it.
use ;
use ;
let input = "{ field }";
let parser = new;
let cst = parser.parse;
let options = default;
assert_eq!;