CLI tool to collect all GraphQL queries, mutations, and subscriptions from a project into a single JSON file, resolving fragments inline. Version 0.2.2 (stable, low release cadence). It precompiles `.graphql` files into a single `documents.json` with AST format, intended for use with Apollo Client or similar GraphQL clients. Differentiator: automates fragment resolution and document bundling without build tool plugins.
npm install graphql-document-collectorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Collects all .graphql files into documents.json and loads them with require.
Pin to exact version and test document structure on upgrade.
Use single quotes around glob: '**/*.graphql'.
Add 'json-loader' to webpack config or use webpack 5 which supports JSON imports natively.
Ensure all fragment definitions are included in the glob pattern or manually included.
Run the CLI command with proper redirection: npx graphql-document-collector '**/*.graphql' > documents.json
Add json-loader to webpack configuration.
Run npm install graphql