Skip to content

v2.1.0

Latest

Choose a tag to compare

@uhyo uhyo released this 30 Oct 10:42
· 2 commits to master since this release

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 .graphql imports directly, without generated .d.graphql.ts files. 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 check now implements the Field Selection Merging validation rule, so conflicting selections with the same response name are rejected. (#133)
  • nitrogql check now 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. Set NITROGQL_DISABLE_TYPE_STRIPPING=1 to opt out. (#143)
  • Generated resolver types now make nullable arguments that have no default value optional. (#145)
  • Fields omitted by @skip/@include are typed as ?: never instead of a required undefined. (#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/@include variables. (#130)
  • nitrogql check keeps 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.