graphql-document-analyzer

JSON →
library 0.7.0 ·javascript
verified Jun 7, 2026

A resilient GraphQL document analyzer that extends GraphQL's built-in `parse` to gracefully handle validation errors, top-level comments, and invalid sections. Unlike the standard parser, it never throws on malformed input, instead representing invalid parts as `InvalidOperationDefinition`, `InvalidFragmentDefinition`, and `Ignored` nodes. It also supports interpolation with previous valid revisions to recover approximate ASTs for in-progress edits, a section-aware visitor, and a print function that preserves all original content including comments and invalid parts. The package is currently at version 0.7.0 and ships TypeScript type definitions.