GraphQL Code Generator Typed Module Declarations
JSON →This `graphql-code-generator` plugin enhances the standard `@graphql-codegen/typescript-graphql-files-modules` plugin by generating TypeScript module declarations for `.graphql` files, but critically, it produces *typed* `DocumentNode` objects. This typing leverages the output of the `@graphql-codegen/typed-document-node` plugin, ensuring type-safety and auto-completion when importing GraphQL operations (queries, mutations, subscriptions) directly from `.graphql` files into your TypeScript codebase. It currently stands at version `1.0.3` and shows a stable release cadence with dependency updates and minor bug fixes. Key differentiators include its focus on generating fully typed `DocumentNode` definitions for imported GraphQL files, allowing for robust type-checking at compile time, which is not directly provided by `graphql-tag/loader` alone without this intermediary type generation. It also supports `.graphql` files with multiple operations, naming imports according to the operation names, enhancing code organization and readability.
Traffic · last 30 days ↑40% vs prev 7d
top countries 🇺🇸 United States · 🇩🇪 Germany · 🇨🇦 Canada · 🇸🇬 Singapore · 🇫🇷 France