@apollo/utils.sortast
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

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 }

Package Sidebar

Install

npm i @apollo/utils.sortast

Weekly Downloads

1,237,719

Version

3.0.0

License

MIT

Unpacked Size

8.93 kB

Total Files

8

Last publish

Collaborators

  • dkuc
  • glasser
  • trevor.scheer
  • apollo-bot