Détail du package

@apollo/utils.sortast

apollographql7.8mMIT3.0.0

Sort AST nodes in a document alphabetically

apollo, graphql, typescript, node

readme

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 }