Repository navigation
nitrogql 2.1 is here! Read the release blog post for the full story.
New Features
- Experimental: TypeScript 7.1 content mapper for GraphQL files. TypeScript can type
.graphqlimports directly, without generated.d.graphql.tsfiles. Supported in both the wasm and native builds. See the guide. (#94, #194, and many follow-ups) - GraphQL diagnostics now carry stable error codes, shown in the CLI output (human,
json,rdjson) and in content mapper diagnostics. (#121) - Syntax errors are reported as structured diagnostics by the CLI. (#134)
Behavior Changes
These may report errors or change types in projects that worked with 2.0:
nitrogql checknow implements the Field Selection Merging validation rule, so conflicting selections with the same response name are rejected. (#133)nitrogql checknow rejects fragments that are only reachable through an implicit transitive#import. Import every fragment you use directly. (#131)- Config and schema TypeScript files are now loaded with Node.js type stripping by default instead of esbuild-register. Type-only imports need
import type. SetNITROGQL_DISABLE_TYPE_STRIPPING=1to opt out. (#143) - Generated resolver types now make nullable arguments that have no default value optional. (#145)
- Fields omitted by
@skip/@includeare typed as?: neverinstead of a requiredundefined. (#193)
Bug Fixes
- Fragments imported from a file already reached through another import are no longer silently dropped. (#131)
- Operation types now merge every compatible combination of nested selections that use different
@skip/@includevariables. (#130) nitrogql checkkeeps validating other documents when an import cannot be resolved. (#147)- The model plugin now uses the field type's model for field-level
@model. (#146) - Fixed the native config loader. (#144)
- The operation type printer returns errors instead of panicking. (#112)
Other Changes
- Selections are printed as plain object types instead of
__SelectionSet, making type checking of operation types faster. (#193) - Internal refactoring of the parser, printer and file store.
- The Next.js example is now a mid-sized issue tracker that uses the content mapper. (#135)
- Rust toolchain updated to 1.99.1.