npm.io
3.0.0 • Published 3 years ago

@apollo/utils.sortast

Licence
MIT
Version
3.0.0
Deps
1
Size
9 kB
Vulns
0
Weekly
0
Stars
41

sortAST

The sortAST function is used to alphabetically sort all of the nodes in a graphql DocumentNode.

Usage

import { sortAST } from "@apollo/utils.sortast";

const sortedAST = sortAST(
  parse(`#graphql
  query Foo { c b a }
`),
);

print(sortedAST);
// query Foo { a b c }

Keywords