3.0.0 • Published 1 year ago

@apollo/utils.sortast v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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 }