A utility library for constructing, parsing, and manipulating GraphQL ASTs programmatically. Version 3.11.0 is current, with regular weekly releases. Unlike codegen-based tools, gql-ast provides a lightweight, type-safe way to build and inspect GraphQL documents and schemas in JavaScript/TypeScript without a runtime dependency on GraphQL.js. Ships full TypeScript definitions and is ESM-first since v3.
npm install gql-astNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a GraphQL schema string and builds an AST using gql-ast.
Switch to ES module import syntax. If you must use CommonJS, stay on v2.x.
Replace `import { gql } from 'gql-ast'` with `import { buildAST } from 'gql-ast'`.Replace `print(doc)` with `printAST(doc)`.
Use gql-ast types only for AST building; convert to graphql-js if needed.
Upgrade to v3.8+ for proper extension support.
Use `import` syntax or downgrade to v2.x.
Import 'buildAST' instead of 'gql'.
Use 'printAST' export.
Use 'Type.String' from gql-ast for AST construction, not graphql-js types.
No dependency data recorded yet.