graphlink 6.1.1
graphlink: ^6.1.1 copied to clipboard
GraphQL code generator: typed Dart, Flutter, Java, TypeScript, Kotlin and Swift clients plus Spring Boot and Express servers from one schema.
1.0.0+1 - 2023-08-14 #
- Initial Release.
1.1.0 - 2023-09-19 #
- All generated data classes have
explicitToJson: true
1.1.1 - 2023-10-19 #
- Updates readme file
2.0.0 - 2024-06-03 #
- Adds
_all_fieldsto target all fields (without class name) - Detects cycles in depencies when generating
all fields fragements - You can use the package as a dev depency instead of a dependecy
- Generates more meaningful class names when a all fields projection is used in queries/mutations.
2.0.1 - 2024-06-04 #
- Fixes
_all_fieldsto target all fields (without class name)
2.0.2 - 2024-06-04 #
- Fixes generated code when
_all_fieldsis used.
2.0.3 - 2024-06-11 #
- Optimizes code generation.
- Generates code much faster.
2.1.0 - 2025-05-14 #
- Generate constructor without
requiredfor nullable argumentsNote: #
if you need to keep generating required nullable fields you need to passnullableFieldsRequired: trueon your build.yaml
2.1.1 - 2025-05-14 #
- Updates project dependcy versions
2.1.2 - 2025-05-14 #
- Adds project links on generated files
2.1.3 - 2025-05-14 #
- Fixes transitive frament reference
2.2.0 - 2025-05-15 #
- Generates declares queries mutations and subscriptions without declaration
You need to pass `autoGenerateQueries: true` on your build.yaml to enable this option
You can also pass `autoGenerateQueriesDefaultAlias` as an alias to be used for queries, mutations and subscriptions.
3.0.0 - 2025-05-21 #
- Generates code for unions
- Generates == and hashcode method using either:
1. @gqEqualsHashcode(fields: ["field1", "field2"])
2. on build.yaml
identityFields: ["field1", "field2"]
Note: In case of Unions and Interfaces, the Retrofit Graphql generates empty interfaces instead of base classes.
3.0.1 - 2025-05-21 #
- Fixed some minor bugs
3.1.0 - 2025-05-21 #
- Generates all implemented interfaces
4.0.0 - 2026-03-12 #
Java / Spring Boot code generation #
- Generates Java types, inputs, enums with
toJson/fromJsonmethods - Generates Java client serializer
- Generates Spring for GraphQL controllers and service interfaces
- Generates repository interfaces (
@glRepository) - Generates null checks on inputs and types
- Generates Java records support
- Generates annotations on controllers
- Validates backend inputs (
@glValidateInput) - Injects data-fetching on mappings
- Generates schema mappings (identity, refactored)
Dart code generation #
- Generates
toJson/fromJsonwithoutjson_serializabledependency - Generates Flutter UI views (optional,
noUi: trueto disable) - Projected interfaces support
- Fixes response generation for single-element queries
New directives #
@glDecorators— attach decorators to generated classes@glSkipOnServer/@glSkipOnClient— skip fields/types per target@glArray— serialize GraphQL lists as arrays (Java)@glInternal— skip internal objects from processing@glExternal— mark external typesextendkeyword supportrepeatablekeyword support for directives- Directives can now apply to fields
CLI & tooling #
- CLI configuration support
- Watch-files mode
- Wildcard filename support
- Handle multiple input files
- Jenkins CI file added
Other improvements & fixes #
- Removes
isScalarfromGqType - Schema generation support
- Annotation serialization on controllers
- Interface directive inheritance
all_fieldsprojection skips@glSkipOnClientfields- Wildcard maps/lists instead of
List<Object>/Map<Object, Object> - Java primitives auto-boxed when nullable
- Multiple subscription fixes
- Various import and serialization bug fixes
4.1.0 - 2026-03-12 #
- Project renamed to GraphLink (package:
graphlink, CLI:glink) - Migrating from
retrofit_graphql: update yourpubspec.yamlandbuild.yamlreferences fromretrofit_graphqltographlink
4.2.0 - 2026-03-22 #
Client-side caching (Dart & Java) #
- New
@glCache(ttl, tags, staleIfOffline)directive — cache any query or field with a TTL and optional tag groups - New
@glCacheInvalidate(tags, all)directive — invalidate tagged cache entries on mutations - Partial query caching: compound queries are split per field; only the uncached fields hit the network
staleIfOffline: truereturns expired cache entries when the network is unavailable instead of throwing- Java: generates
ResolverBase,GraphLinkCacheEntry,GraphLinkTagEntry,GraphLinkPartialQueryhelper classes - Java: generates thread-safe cache helpers using
ReentrantLockper tag - Java integration tests mirroring the Dart cache integration test suite
Configuration #
- New
config.jsonCLI-based configuration (alternative tobuild.yaml) — use withdart run lib/generate.dart clientConfig.javablock for Java-specific options (packageName,immutableInputFields,immutableTypeFields, etc.)
4.3.0 - 2026-03-31 #
New features #
- New built-in GraphQL parser — replaces
petit_parserdependency (removed) - Default type adapters for Dart client serializer
- Default type adapters for Java client serializer
- Enum initial/default values support
- Spring Boot: schema mapping methods now support arguments
Fixes & improvements #
- Code generation is now ~4x faster
- Fixed FNV1a hash JS compatibility in Dart cache store
- Internal unique-name refactor for more consistent generated class names
- Updated Java server example
4.3.1 - 2026-04-04 #
Fixes & improvements #
Fixes a bug immutableInputFields and immutableTypeFields for spring boot code generation.
4.4.0 - 2026-04-14 #
New features #
-
Injectable HTTP client —
DefaultGraphLinkWebSocketAdapternow accepts anHttpClient(Java 11) orOkHttpClient(OkHttp) as a constructor argument, allowing you to bring your own pre-configured client (proxy, SSL, timeouts, etc.). The no-arg and headers-only constructors still work unchanged. -
DefaultGraphLinkWebSocketAdapterreconnects by default — the Dart adapter'sreconnectflag now defaults totrue. Previously it defaulted tofalse, requiring an explicit opt-in to enable automatic reconnection after a disconnect. -
Safe generated variable names — internal local variables emitted inside generated client methods are now prefixed/suffixed (
__gl_name__) to avoid accidental collisions with user-defined argument names (e.g. a query argument namedqueryorresponseno longer shadows the internal variable). -
MVC security context propagation — new
useSpringSecurity: trueoption inconfig.json(clientConfig.java). When enabled (MVC mode only), the generated controllers capture theSecurityContextbefore entering aCompletableFuturelambda and restore it on the worker thread, so Spring Security's authentication is available inside async service calls. Has no effect in reactive mode. -
Forward mappings — when a type uses
@glSkipOnServer(mapTo: "ServerType"), fields that exist verbatim on the server type (same name and structural type) are now auto-forwarded in the generated controller without creating a service method. Only fields absent from the server type, or explicitly annotated with@glSkipOnServer, still get a full@SchemaMapping+ service delegation. -
Reactive Spring server — new
reactive: trueoption inconfig.jsonenables Spring WebFlux-style controller generation. Controllers returnMono/Fluxtypes and file upload fields useFilePartinstead ofMultipartFile. -
File upload support — GraphQL multipart upload spec is now supported across all three targets. Dart clients (http and Dio) receive a
GLUploadtype with a stream, length, filename and mime type. Java clients get the equivalentGLUploadclass. Spring Boot controllers acceptMultipartFile(MVC) orFilePart(reactive). -
Input mappings (
@glMapsTo/@glMapField) — annotate a GraphQL input type with@glMapsTo(type: "GraphqlType")to declare that it maps to an existing Java/Dart class. Use@glMapField(to: "fieldName")on individual fields to rename them during mapping. GraphLink validates all target types and field names at generation time and emits a mapping constructor/method on the generated input class.
Fixes & improvements #
- Validation code calls wrapped in
CompletableFuture @glSkipOnClient/@glSkipOnServerapplied to validations- Completable future support in Spring controllers
- Optimized Spring service imports
- Fixed Java input
toJsoncall on client - Removed
@glArraysupport - Fixed default Dart WebSocket adapter
- Refactored GL mapping
4.4.1 - 2026-04-19 #
Fixes #
- Fixed deserialization of query responses when the return type is an interface or union
4.5.0 - 2026-04-19 #
New features #
- TypeScript client code generation — new
clientConfig.typescriptblock inconfig.json - Generates typed client for queries, mutations, and subscriptions
- HTTP adapter:
fetch(default, works in Angular, React, Svelte, Vue) oraxios(Node/Bun environments) - Optional RxJS observables mode (
observables: true) as an alternative to promises - Generates a default WebSocket adapter for subscriptions (
generateDefaultWsAdapter: true) - Nullable input fields are optional by default (
optionalNullableInputFields: true) - Supports
generateAllFieldsFragments,autoGenerateQueries,operationNameAsParameter,immutableTypeFields
Improvements #
- Generated Dart files: version number now embedded in the file header comment
- Generated GraphQL files: version number now embedded in the file header comment
dart:mathimport in generated Dart client only emitted when subscriptions are present
4.5.1 - 2026-04-21 #
Fixes #
- Fixed
@glMapsTo/@glMapField:toXxx()andfromXxx()now respect@glSkipOnClient/@glSkipOnServer— fields invisible to the target mode are no longer emitted as parameters or assignments, preventing compilation errors in generated code - Fixed
@glMapsTo/@glMapFieldin Java: primitivebooleanfields now correctly useisXxx()getters instead ofgetXxx()in bothtoXxx()andfromXxx()methods
4.5.2 - 2026-04-22 #
Fixes #
- Fixed
@glMapsTo: nested input fields whose type has no@glMapsTodirective are now correctly treated as required parameters instead of being silently auto-mapped - Fixed
@glMapsTo: fields with different GraphQL tokens that serialize to the same target type (e.g.String!andID!) are now correctly treated as compatible and auto-mapped - Fixed
@glMapsToin Java:java.util.Listis now imported whenrequiredParamsordefaultParamscontain list types
4.5.3 - 2026-04-23 #
Fixes #
- Fixed Dart/Java: interface getter declarations now correctly force nullable field types in server mode
- Fixed Dart
@glMapsTofromXxx(): scalar non-list fields where the type field is nullable but the input field is non-null are now emitted as required parameters instead of being silently auto-mapped - Fixed Dart
@glMapsTofromXxx(): list fields whose nestedfromXxx()requires extra parameters are now escalated to required parameters instead of generating an invalid inline.map()call - Fixed Dart
@glMapsTofromXxx(): nullable target type now emits a null-safety guard (!= null ? … : null) instead of an unconditional call - Fixed Dart client:
http_parserimport is now only emitted when upload mutations are present - Fixed Java: type field constructors, getters, and getter declarations now correctly force nullable types in server mode
4.5.4 - 2026-05-03 #
- Fix missing space between fields in dynamically built queries (Dart, Java, TypeScript clients)
4.6.1 - 2026-05-15 #
Fixes #
- Fixed
@glMapsToJava: boxedBooleanfields now correctly usegetXxx()accessors instead ofisXxx()in generatedtoXxx()andfromXxx()methods
4.6.0 - 2026-05-14 #
New features #
- Operation name in URL — when
operationNameAsParameter: trueis set, the operation name is now appended as a query parameter in the HTTP request URL - YAML config support — the config file can now be
.json,.yaml, or.yml. All existing JSON configs continue to work unchanged. - Default config discovery — the
-cflag is now optional. When omitted,glinksearches forglink.json,glink.yaml, orglink.ymlstarting from the current directory and walking up to the filesystem root.
Fixes & improvements #
- Fixed Dart client: subscription connection creation
- Fixed interface: duplicate
__typenamehandling in switch statements - Fixed interface:
@glSkipOnClientcorrectly applied to interface implementors on the client - Fixed
@glMapsToclient mode: mapping methods and imports are now suppressed when the target type is not among the projected (generated) types, preventing broken type references in the client output - Fixed
@glMapsToDart & Java: nested non-list mapped input fields whosefromXxx()requires extra parameters are now correctly promoted to required parameters instead of generating an invalid auto-call - Fixed
@glMapsToJava:fromXxx()primitivebooleantarget fields now correctly useisXxx()getters instead ofgetXxx() toXxx()andfromXxx()are no longer generated when the source or target instance would be entirely unused — an input whose mapped fields are all required parameters with nothing derivable from the target no longer emits a misleading method body
Internal #
MappingPlansplit intoToMappingPlan(forward direction) andFromMappingPlan(reverse direction) — all field-categorization logic is now fully encapsulated in the model; serializers are pure emitters with no resolution logic of their own
4.7.0 - 2026-05-25 #
Breaking changes #
-
@glCachettltype changed fromInttoString— thettlargument now accepts a human-readable duration string instead of a bare integer.Migration: replace every bare integer TTL with a quoted duration string:
# Before getVehicle(id: ID!): Vehicle! @glCache(ttl: 120, tags: ["vehicles"]) # After getVehicle(id: ID!): Vehicle! @glCache(ttl: "2m", tags: ["vehicles"])Supported formats:
"<n>s"(seconds),"<n>m"(minutes),"<n>h"(hours),"<n>d"(days), or a bare integer string"300"(treated as seconds). The generator emits a clear error if a bare unquoted integer is found.Update the directive declaration in your schema file to match:
# Before directive @glCache(ttl: Int!, ...) on ... # After directive @glCache(ttl: String!, ...) on ...
New features #
-
@glCaptureErrorsdirective — opt a query or mutation into inline error handling. The generated method returns{OperationName}FullResponsewith a nullabledatafield and a nullableerrors: List<GraphLinkError>field instead of throwing on GraphQL errors. Supported in Dart, Java, and TypeScript.type Query { getUser(id: ID!): User! @glCaptureErrors }Enable globally for all queries and mutations via config:
"clientConfig": { "dart": { "captureErrors": true } }Error responses are never written to the cache. Non-annotated operations are unaffected.
-
Flutter UI widget generation — new
flutterconfig block generates Flutter widgets for GraphQL types and inputs. Configurable options:generateTypes(defaulttrue) — generate display widgets for output typesgenerateInputs(defaultfalse) — generate form widgets for input typestypesToSkip/inputsToSkip— exclude specific types from generationdefaultGap(default16) — spacing between field rowsbooleanWidget—switchWidget(default),checkbox, ortristatenullableBooleanWidget—checkbox(default) ortristatelistWidget—chips(default) orcheckboxesdefaultLabelPosition—floatingLabel(default),beside, orabovedefaultFormLayout—column(default) ortwoColumndefaultRequiredIndicator—asterisk(default),none,requiredText, oroptionalTextdefaultStepperOrientation—vertical(default) orhorizontaldefaultTypeLayout/defaultGroupLayout—labeledRow(default),listTile,listTileReversed, orexpandabledefaultDatePattern,defaultDateFirstYear,defaultDateLastYear,defaultDateMode(dialogorinline)defaultDebounceDuration(default300ms) — debounce delay for text input fields
-
Barrel file generation — Dart and TypeScript generators now emit a single barrel/index file that re-exports all generated enums, inputs, types, and interfaces. A single import is enough to access the entire generated layer.
-
@glExpanddirective — controls inline expansion depth for cyclic types in_all_fieldsfragment generation. When a cycle is detected, the generator inlines the cyclic type's fields up todepthlevels instead of emitting an invalid recursive fragment spread. Default depth is1. Usedepth: 0to omit the cyclic field entirely.type Employee @glExpand(depth: 2) { id: ID! name: String! manager: Employee } -
Exhaustive projection reuse — when a query projects all fields of a type completely (recursively), the generator now reuses the base type name instead of generating a new projected type name. This reduces the number of generated classes and makes generated code easier to navigate.
-
generateAllFieldsFragmentsandautoGenerateQueriesdefault totrue— these options no longer need to be explicitly set inconfig.json; they are enabled by default. -
Incremental file writes — the generator now hashes each output file's content before writing. Files whose content has not changed are skipped, making repeated generation and watch mode significantly faster on large schemas.
Fixes #
- Fixed Flutter input form widget generation (state management, date fields, companion handling)
- Fixed missing import for enum list labels in generated Flutter display widgets
- Improved parse error messages now include line and column numbers
Documentation #
- Site migrated to MkDocs — all documentation pages rebuilt with improved navigation and search
- New AI Agents documentation page covering GraphLink's LLM-friendly design
- Configuration, client, and server docs updated throughout
4.8.0 - 2026-06-09 #
New features #
-
Kotlin client code generation — new
clientConfig.kotlinblock inconfig.json- Generates typed client for queries, mutations, and subscriptions
- Data classes for types and inputs (configurable via
typeAsDataClass/inputAsDataClass) toJson/fromJsonserialization usingkotlinx.serialization- WebSocket adapter:
okhttp(default) ornone - Enums, interfaces, and union types fully supported
@glMapsTo/@glMapFieldmapping methods generated
-
JSpecify null-safety annotations for Java — new
jspecify: trueoption inclientConfig.javaandclientConfig.server- Adds
@NonNull/@Nullablefromorg.jspecify.annotationsto all generated type, input, and interface fields - Respects
@glSkipOnClient/@glSkipOnServerand server-mode forced nullability rules - Imports are only emitted when the option is enabled
- Adds
-
Flutter display widget improvements
- Serializer split into focused sub-files:
flutter_types_layout_serializer.dart,flutter_types_companion_serializer.dart,flutter_types_value_renderer.dart,flutter_types_constants.dart - New
labelStyleconfig option (bold/muted) for companion label classes - Generated
{Type}Widgetnow includes an agent guide header comment block listing every field, its Dart type, and how it is rendered — makes generated widgets easier to navigate with AI tools - New layout helpers:
toTableRow,toDataRow,toDataColumns,labeledTableRows,listTileItems,expandableItems
- Serializer split into focused sub-files:
-
Flutter input form enhancements
- Async validation state per field (
_<field>Validating,_<field>AsyncError,_<field>AsyncTimer) with debounce support - Field keys (
GlobalKey<FormFieldState>) generated for every validatable field — enables_scrollToFirstError isDirtygetter,scrollToFirstError,updateErrorsNotifier, andscrollToFieldhelpers emitted automaticallysetSubmittingpropagated to nested sub-input forms (stepper child forms disabled together)- Optional
focusNodesparameter when text fields are present - New
${Input}FieldIconscompanion class — pass aWidget?per text or dropdown field to render asprefixIconin itsInputDecoration TextFieldOptionsgainsprefixIconandsuffixIconfields — lower-priority icon slot overridden byFieldIconsat the field level; password-toggle always wins the suffix- New
{field}Avatarcallbacks on${Input}Widgets—Widget? Function(T)?per enum field andWidget? Function(bool)?per bool field; rendered asChoiceChip.avatarin chip/radio rows
- Async validation state per field (
Fixes #
- Fixed barrel file to include generated client files (Dart and TypeScript)
5.0.0 - 2026-07-12 #
Breaking changes #
-
Server generation is strict by default — every server-generated type and interface now enforces real schema nullability on its fields (getters/constructors/setters), instead of the previous always-nullable server model.
Migration: if you relied on server-generated types being fully nullable, annotate them with the new
@glServerLenientdirective to restore the old per-type behavior. Combined with controllers now serializing responses viatoJson()toMap(see below), a resolver can return a partially-populated@glServerLenientobject with un-fetched fields leftnull— enough to satisfy selection-driven partial fetches without any dedicated projection type. -
Generated identifiers are always normalized to the target language's casing convention — field names, argument names, enum values, and type/input/interface/union/enum names are now unconditionally rewritten to canonical casing (e.g. lowerCamelCase fields for Dart/Java/Kotlin/TypeScript, SCREAMING_SNAKE enum values for Java/Kotlin, PascalCase enum values for TypeScript, PascalCase type names everywhere). This is not opt-in.
Migration: if your schema's GraphQL names aren't already in canonical casing (e.g.
snake_casefields, lowercase type names), regenerating will rename the corresponding generated fields/classes/methods. Review the diff after upgrading and update any application code that references generated identifiers directly. -
Generated server controllers now return
Map/List<Map>instead of typed objects — Java Spring, Kotlin Spring, and Express/Apollo controllers serialize responses viatoJson()at the controller boundary; service interfaces are unchanged. Any code depending on the old typed controller return type needs to be updated after regenerating. -
Java Spring controllers bind input arguments as
Map<String, Object>— controller methods no longer receive Spring-bound typed input objects directly; they receive a raw map and convert it via the input's generatedfromJson. This keeps keyword-renamed and normalized input fields correct on the wire, but any custom Jackson/Spring binding configuration relying on the previous direct-typed binding will need to be revisited. -
Kotlin generated enum
fromJsonno longer returns null for unknown values — signature changed fromfun fromJson(value: String?): T?tofun fromJson(value: String): T; an unrecognized wire value now throwsIllegalArgumentExceptioninstead of returning null. -
Field-level arguments are no longer silently dropped — arguments on nested (non-root) fields (e.g.
lastArticles(limit: Int!)) are now detected wherever the field is selected (explicit query, fragment, or auto-generated all-fields projection) and turned into operation variables / method parameters. Regenerated client methods for existing operations that select such fields gain new parameters. To keep generated method signatures from exploding on schemas with many field-level arguments, these propagated arguments are automatically grouped into a single synthesized<Operation>FieldArgsinput object rather than appended as a flat parameter list — seeautoGenerateQueriesArgumentLimitbelow for schemas where even that isn't enough. -
Cyclic types are always forced nullable, not just under
@glExpand— fields participating in a dependency cycle between types are now unconditionally nullable in generated types (default-on SCC-based cycle detection), rather than only when explicitly bounded by@glExpand(depth: …). Code that force-unwraps such fields (!in Dart/Kotlin, non-null assumptions in Java/TS) may need updating after regeneration. -
Auto-generated query variable names changed — auto-generated operation variable names are now
$<fieldName><ArgName>instead of bare$<argName>, to avoid collisions across fields and fragments (with further type-suffix disambiguation when the same field+arg name resolves to different types across the schema). This changes the wire-level.graphqlquery strings emitted for auto-generated operations; regenerated output will differ even though behavior is equivalent. -
toJson/fromJsongeneration is now mandatory — every language serializer (Dart, Java, Kotlin, TypeScript) previously accepted agenerateJsonMethodsflag that could suppress serialization methods on types, inputs, and interfaces. That flag has been removed:toJson/fromJsonare now always generated, on both client and server, since identifier normalization and reserved-keyword renaming mean a field's generated identifier can differ from its wire name — code that reads/writes generated objects without going throughtoJson/fromJsoncan no longer assume the two match. -
generateTypes/generateInputsremoved fromserverConfig.springandserverConfig.kotlinSpring— types, inputs, interfaces, and enums are now always generated for both the Java and Kotlin Spring server targets.generateControllersandgenerateRepositoriesremain and are now correctly honored by the Java target as well (previously only the Kotlin target respected them; Java silently generated controllers and repositories regardless of these settings). Migration: removegenerateTypes/generateInputsfrom yourserverConfig.spring/serverConfig.kotlinSpringconfig — they are now ignored if left in place — and double checkgenerateControllers/generateRepositoriesreflect what you actually want, since Java now enforces them.
New features #
-
@glInjectContextdirective — per-field opt-in to inject the request context into a single resolver/service method (SpringGraphQLContext, Apollocontext: GraphLinkContext), without turning it on globally. OR'd with the globalinjectContextconfig. For Apollo/Express, thecontextparameter is now injected only when@glInjectContextis present orinjectContext: trueis set (newserverConfig.expressApollo.injectContextoption) — matching the Spring targets — instead of being passed to every resolver unconditionally. -
Kotlin Spring Boot server generation — new
serverConfig.kotlinSpringblock generates Kotlin data-class types/inputs/enums, services, controllers, and repositories, mirroring the existing Java Spring server target.typeAsDataClass/inputAsDataClasscontrol data-class vs. open-class generation;blockingServices(defaulttrue) wraps service calls inwithContext(Dispatchers.IO), or set tofalsefor a coroutine-native service layer. -
Reactive Java client generation — new
asyncStyleoption inclientConfig.java:blocking(default, unchanged),reactor,rxjava3, ormutiny. Reactive styles wrap query/mutation results in the library's deferred-single type (Mono/Single/Uni) and subscriptions in the deferred-many type (Flux/Observable/Multi).reactiveHttpClientselects the default adapter's transport:jdk(HttpClient.sendAsync, works with every reactive style, no extra dependency) orwebclient(Spring WebClient, Reactor only). File upload support was also added for the Java client in this pass. -
unknownScalarTypeconfig option — fallback target-language type for any custom GraphQL scalar not covered bytypeMappingsor@glExternal. Without it, an unmappedscalar UserIdis emitted verbatim asUserId; set it to e.g."String"(Dart),"string"(TypeScript), or"Object"(Java) to map all such scalars uniformly."typeMappings": { "ID": "String" }, "unknownScalarType": "String" -
Reserved-keyword-safe generated identifiers — a GraphQL field, argument, enum value, or input field named after a target-language keyword (e.g.
default,return,object) now gets a sanitized generated identifier (default_, with numeric suffixing on further collisions) while the wire/GraphQL name is preserved; applied consistently across fields, arguments, enum values, resolver parameters,@glMapsTomappings, and Spring controller/service signatures for Dart, Java, Kotlin, and TypeScript. Fields whose GraphQL name starts with a leading underscore also get a safe generated name where the target language disallows or discourages it. -
@glExpandcyclic-projection nullability, decoupled from opt-in usage — see the corresponding entry under Breaking changes; SCC-based cycle detection now runs by default instead of only inside explicit@glExpand(depth: …)annotations. -
Bodyless type/interface/input definitions — a type/interface/input can now be declared with no body (
type Query { }) as long as a laterextendblock supplies its fields, with a validation error if it's never extended. Useful for schemas split across multiple files where the root type is declared in one file and extended in others. -
Client-side default values — GraphQL
= valuedefaults on input fields and query/mutation arguments are now emitted as real defaults/params in generated Dart, Java, Kotlin, and TypeScript code (previously parsed but silently dropped). Dart constructors becomeconstwhere possible. The generated.graphqlsschema output now also preserves the= value. -
@deprecateddirective support in generated code — fields and enum values marked@deprecated(reason: "...")now emit the target language's native deprecation annotation (@Deprecatedin Dart/Java/Kotlin,@deprecatedJSDoc in TypeScript) with the reason carried through. -
autoGenerateQueriesForconfig option — restrict auto-generated queries/mutations/subscriptions to an explicit allow-list per operation type, instead of auto-generating one for every root field:"clientConfig": { "dart": { "autoGenerateQueriesFor": { "queries": ["getUser", "listOrders"], "mutations": ["createOrder"] } } } -
maxFragmentBodySizeconfig option (default8192) — auto-generated_all_fieldsfragments whose serialized body exceeds this size (and any auto-generated operations depending on them) are skipped with a warning instead of emitting an oversized fragment; hand-written operations are unaffected. Set tonullto disable the cap. Targets very large schemas (e.g. Shopify, GitHub, GitLab) where fragment bodies can reach tens of kilobytes. -
autoGenerateQueriesArgumentLimitconfig option (default200) — caps the number of propagated field arguments an auto-generated operation may accumulate before it's skipped with a warning; works alongside the automatic<Operation>FieldArgsgrouping (see Breaking changes) as a last-resort safety valve for schemas with pathological argument counts. -
TypeScript
toJson/fromJsongeneration — TypeScript types, inputs, enums, and interfaces now get generatedtoJson/fromJsonfunctions bridging wire names and normalized code names (mirroring the existing Dart/Java/Kotlin behavior), and the TypeScript client decodes responses through generatedfromJsoninstead of raw type casts. TypeScript interfaces implementing a union also emit areadonly __typename: 'TypeName'discriminant field plus a union-leveltoJson()that switches on__typename, completing proper discriminated-union (de)serialization. -
Only-used fragments are emitted — generated clients now include only the fragments actually referenced (directly or transitively) by at least one query, mutation, or subscription, shrinking generated fragment maps on large schemas.
-
Slimmer generated client code for non-cached queries — operations with no
@glCache-tagged fields now go through a simplified, smaller code path instead of the full partial-caching machinery, reducing generated client size; shared resolver helpers were also factored out across Dart/Java/Kotlin/TypeScript client serializers to cut duplicated boilerplate. -
Multi-arch Docker release images — the published
glinkDocker image is now built and released for multiple architectures. -
@glInterceptdirective — generic pre-execution interceptor for server targets, giving Apollo/Express the same "authorization runs before the service method" guarantee Spring Boot gets from AOP. Annotate a field or anextend type ... @glIntercept(tag: "...")block; intercepted operations call a single generatedGlInterceptor.runBefore(tag, operation, args, context)before dispatching to the service — throwing denies the call, returning normally proceeds. Object-level@glInterceptscopes only to the fields declared in that block, not the fully-merged type. Server-only: the same schema still builds cleanly in client mode, where the directive is silently ignored (no interceptor enum/interface/call site emitted). Supported on Express/Apollo (TypeScript), Java Spring, and Kotlin Spring.
Fixes & improvements #
- Fixed several field-level-argument propagation and cache-scoping bugs: dropped field args in partial/divided-query variable declarations, and incorrect per-query-element variable scoping.
- Fixed the default WebSocket subprotocol negotiation on the Dart/Java/Kotlin adapters and the TypeScript server/client (now consistently
graphql-transport-ws); the TS adapter also reconnects on socket error, not just close. - Fixed a parser crash on description strings attached to a directive/field argument.
- GraphQL spec-compliance fixes in the lexer/parser: optional leading
|/&in directive-location, union-member, andimplementslists;extendwithout a{ }body;"""inside block strings no longer prematurely terminates the string. - Fixed a stack overflow in cyclic-fragment expansion for long non-cyclic dependency chains, and an out-of-memory issue in the large-schema fragment pipeline.
- Fixed
fromJsondispatch when an interface extends another interface — sub-interfaces are no longer emitted as bogus concretecasebranches. - Fixed exponential-time field-argument-variable propagation over shared fragment graphs via memoization (large measured speedup on synthetic large-schema benchmarks); added a fast path for exhaustive projection registration on interfaces/unions.
- Fixed auto-generated response wrapper type names (
<Field>Response) colliding with a user-declared type of the same name — falls back deterministically to<Field><Operation>and then a numeric suffix only on collision. - Fixed a collision between a query and a mutation sharing the same field name.
- Fixed union "common fields" validation incorrectly accepting/rejecting fields with mismatched types across union members.
- Fixed Java interface list fields to use covariant wildcards (
List<? extends T>) only where a server implementor actually narrows the element type, and only in server mode — client-generated list fields stay unwildcarded for ergonomic caller-side types. - Fixed multiline and otherwise special-character
@deprecated(reason: "...")strings producing invalid generated syntax. - Fixed a null-default leak when merging field arguments.
- Fixed a duplicate TypeScript enum value emitted for deprecated enum members.
- Fixed a TypeScript self-import in generated import dependency resolution.
- Fixed unescaped quotes in generated Java query strings.
- Fixed an unqualified enum member reference in generated Dart/Kotlin
fromJson. - Fixed several identifier-normalization/keyword-safe-naming ordering bugs affecting auto-generated query codenames, and
hasQueries/type-emission bookkeeping around fragments skipped bymaxFragmentBodySize. - Fixed Kotlin/Java
toJson/fromJsonfor enums to always use explicit wire-name mapping instead of.name/valueOf, since normalization can make code names diverge from wire names even without a keyword collision. - Fixed a TypeScript default-argument bug where a non-null-typed argument with a default value could be
undefinedat runtime and bypass the default via unguarded nullish coalescing. - Fixed the generated Dart barrel file emitting duplicate export lines.
- Fixed a missing space between
implements ...and the opening brace in generated Java interfaces. - Fixed Java/Kotlin Spring controllers emitting
getXxx()for primitivebooleanfields instead of the correctisXxx()getter. - Fixed TypeScript/Express server generator parity gaps against the Java/Kotlin targets and hardened the associated integration tests.
- Fixed
@glServerLenientbeing applied after schema mappings instead of before, which could leave mapped fields incorrectly non-nullable. - Fixed Express/Apollo generated resolvers to scope DataLoaders per-request instead of sharing them across requests, preventing stale/cross-request cache leaks.
5.1.0 - 2026-08-08 #
New features #
- Swift client code generation — new
clientConfig.swiftblock inconfig.jsongenerates a fully typed Swift client (types, inputs, enums, interfaces/unions asstruct/protocol, plus the operation-independent and per-operation runtime) with zero third-party dependencies:async/awaitthroughout; queries, mutations, and uploads areasync throws, subscriptions return anAsyncThrowingStream- Default WebSocket adapter (
wsAdapter: "urlsession", or"none"to emit only the adapter typealias) built onURLSessionWebSocketTask— no dependency, works on Apple platforms and Linux (swift-corelibs-foundation) - Default multipart upload adapter (
DefaultGraphLinkURLSessionMultipartAdapter) and aGLUploadtype for file upload mutations actor-basedInMemoryGraphLinkCacheStoreimplementingGraphLinkCacheStorefor@glCache/@glCacheInvalidatesupport, mirroring the Kotlin client's cache shape@glCaptureErrorssupport (captureErrorsconfig option or per-field directive)toJson/fromJsongenerated on every type, input, enum, and interface, matching the mandatory-serialization behavior introduced for the other targets in v5.0.0immutableTypeFields(defaulttrue),autoGenerateQueriesFor,maxFragmentBodySize, andautoGenerateQueriesArgumentLimitall supported, same as the Kotlin/TypeScript/Java client configs- New
integration_tests/swift_client_tests/andswift_client_tests_real/suites covering caching, cycles, enums, error capture, inputs, lists, nullability, query strings, scalars, subscriptions, and uploads
Fixes #
- Fixed a crash when merging structurally-identical projected interfaces derived from different original interfaces (e.g. two queries each selecting the exact same field subset off a base interface and one of its sub-interfaces) — the merge re-added a directive already present on the shared field and threw "Directive already exists" instead of treating it as a no-op.
Internal #
- Java, Kotlin, TypeScript, and Express/Apollo client/server serializers reworked to build their generated code through the shared
*CodeGenUtilsblock builders instead of hand-formatted string templates, for consistency with the new Swift serializer. - Removed dead payload-handling code duplicated between the Kotlin and Swift client constants.
- Refactored the Java client's reactive type wrapper (
JavaReactiveFlavor) and added ajava_reactive_clientsuite to the server integration test matrix. - Release workflow now builds each platform artifact (Linux x86_64/arm64, Windows, macOS x86_64/arm64) as an independent job instead of one shared matrix.
5.1.1 - 2026-09-09 #
Fixes #
- Fixed
@glSkipOnClienton a whole type/interface/input/enum not being stripped from the client pipeline — only individually-marked fields/enum values were being removed before. Whole skipped definitions (and their interface implementation links) are now removed as well, and a field/argument/input that still references a skipped definition now raises a clear parse error instead of leaking it into generated client code. - Fixed the Flutter
noUitypes serializer not honoring@glSkipOnClienton a whole type, so a client-skipped type could still be emitted as a Flutter UI type. - Fixed generated Flutter input
Listfields with hidden defaults being typed/serialized incorrectly instead ofList<T>?.
5.1.2 - 2026-09-14 #
Fixes #
- Fixed Java Spring controllers throwing
NullPointerExceptionwhen a nullable list-of-input argument (e.g.items: [ItemInput!]) is omitted by the client — the generatedfromJsonconversion now null-guards the list before calling.stream(), matching the null-safety already present for scalar/single-input nullable arguments (and already correct in the Kotlin/TypeScript server targets).
5.2.0 - 2026-09-24 #
New features #
-
Flutter: non-deprecated widget APIs via
flutter.sdkVersion— newsdkVersionoption in theflutterconfig block (e.g."3.47.5") selects which Flutter APIs the generated widgets use. From3.35on, generated input forms emitRadioGroup<T>around their radio tiles instead of the deprecatedRadioListTile.groupValue/onChanged(per-tile disabling moves toenabled:), andDropdownButtonFormField(initialValue:)instead of the deprecatedvalue:. This removes the deprecation warnings generated forms produced on recent Flutter SDKs. When unset, the pre-3.35 API is generated, so existing projects see no change. Quote the value in YAML (sdkVersion: "3.10"): an unquoted3.10is read as the number3.1. A malformed value fails generation with a clear error."flutter": { "generateInputs": true, "sdkVersion": "3.47.5" } -
Flutter:
designLibraryoption for the standalone Material/Cupertino packages — newdesignLibraryoption in theflutterconfig block:flutter(default) keepspackage:flutter/material.dartandpackage:flutter/cupertino.dart;standalonemakes generated files importpackage:material_ui/material_ui.dartandpackage:cupertino_ui/cupertino_ui.dart(Flutter 3.47+; add both packages to yourpubspec.yaml). It must match the library your app uses, since generated types such asTextFieldOptionsexpose Material types. -
Flutter: clear (X) button on generated text fields — new
flutter.defaultClearButtonoption (defaultfalse) and a per-fieldTextFieldOptions.clearButton(bool?, set through the form'sTextConfig;nullfalls back to the default). The button appears onString,int,doubleand dialog-mode date text fields while the field is enabled and non-empty, and clearing a required field lets normal validation block submission. It is replaced by the spinner during async validation, never shown on password fields, and sits next to a date field's calendar button or a customsuffixIcon. Tooltip text comes from the newFormStrings.clear(default"Clear").
Improvements #
- Generated Flutter
boolean_labels.dartnow importspackage:flutter/widgets.dartinstead of Material, anddate_input_config.dartno longer emits an unused Material import. Regenerating changes these two files even with the default config. - Generated dialog-mode date fields now honor the field's
TextConfigentry forprefixIconanddecoration(previously ignored);FieldIconsand the calendar button keep precedence. - Generated
GraphLinkQueries/GraphLinkMutationsconstructors with nothing to initialize now end in;instead of an empty{}block (GraphLinkSubscriptionskeeps its block).createConstructortreats an empty statement list like no statements.
Internal #
- New
FlutterApi(serializers/flutter_api.dart) centralizes the Flutter SDK-version feature gates and the Material/Cupertino import paths; the four radio sites (enum, nullable bool, non-null bool, select) now share oneFlutterInputsRadioBindinginstead of four hand-writtenRadioListTileblocks.
5.3.0 - 2026-09-28 #
Breaking changes #
-
Flutter input forms:
${Input}Valuesoverrides for text, enum and bool fields now receive the field label — the builder signature changed fromInputFormWidget<T> Function(Key)?toInputFormWidget<T> Function(Key, Widget label)?. Previously an override replaced the whole generated row, so the required indicator (*) and the info tooltip were silently lost.labelis the same combined widget the default row uses (required indicator plus info icon); place it wherever you want, or ignore it. List and nested-input fields keep theFunction(Key)signature.Migration: update your override callbacks.
// Before values: PersonValues(name: (key) => MyNameField(key: key)) // After values: PersonValues(name: (key, label) => MyNameField(key: key, label: label))
New features #
- Flutter: replace a whole nested-input form (stepper step) via
${Input}Values— nested input fields can now be overridden with anyInputFormWidget<Child> Function(Key), in both the stepper layout and thecolumn/twoColumnlayouts. The custom widget'sInputFormState<Child>is driven by the parent form exactly like a generated child form (read,validate,reset,isDirty,setSubmitting). Step titles/subtitles still come from${Input}StepConfig.
5.4.0 - 2026-10-15 #
New features #
--debounce <ms>CLI flag for watch mode —glink -wnow waits until schema changes have settled for--debouncemilliseconds (default500) before regenerating, so a burst of saves, or replacing a whole directory of.gqlfiles (rm -rf+cp -r), triggers a single run instead of one per detected change. Must be a non-negative integer.
Fixes & improvements #
- Fixed watch mode exiting when a
schemaPathsglob momentarily matches nothing (e.g. while files are being replaced). It now reports the error and keeps watching, regenerating once the files reappear. Outside watch mode the behavior is unchanged (exit code 1). - Watch mode no longer starts a new generation while one is still running; changes that arrive mid-run are collapsed into a single follow-up run. All files changed in one poll are now picked up together.
- Fixed generated files not being recreated in watch mode when they were deleted from disk after a previous generation in the same process: the incremental-write cache now also checks that the file still exists.
Documentation #
--debouncedocumented in the CLI flags reference, the getting-started watch-mode section,--help, and the LLM context headers.
5.4.1 - 2026-10-26 #
Fixes #
- Fixed Java Spring controllers calling the service method twice when the result is nullable (once for the null check, once for
.toJson()). The result is now stored in a local variable and the type is imported in the controller.
5.5.0 - 2026-10-29 #
New features #
-
Flutter: draft persistence for generated input forms — new
flutter.persistDraftsoption (defaultfalse). When enabled, every generated form gets optionaldraftStoreanddraftIdparameters, so a user who fills in part of a form and leaves finds their progress when they come back. Storage is up to you: implement the generatedFormDraftStoreinterface (read/write/deleteby key, all async) over SharedPreferences, secure storage, a file, or your backend. GraphLink adds no dependency.- Drafts are saved as JSON under
graphlink_generated_form_<InputName>(suffixed with:<draftId>when given), a short debounce after each change, and flushed when the form is disposed, so leaving right after typing still saves.<Input>Form.draftKeyFor(id)returns the key. - The form is disabled until its saved draft is restored, and
read()throws while restoring. A missing, unreadable or failing store never leaves the form disabled. - Password-like fields are never saved. A draft saved by a different version of the input (fields added, removed or retyped) is discarded.
- Nested input forms save their own drafts under the path-derived id
<parentId>.<field>. - A full
reset()deletes the draft. After a successful submit, delete it yourself withstore.delete(MyInputForm.draftKeyFor(id)). - Fields replaced through
${Input}Valuesare saved through theirread()and restored through the newInputFormState.restore(T value), a no-op by default that your widget can override. This hook is generated only whenpersistDraftsis on.
"flutter": { "generateInputs": true, "persistDrafts": true }With the option off, generated output is unchanged.
- Drafts are saved as JSON under
5.6.0 - 2026-11-01 #
New features #
-
Persisted queries (APQ) — new
persistedQueriesoption (false|"apq", defaultfalse) on every client language (Dart, Java including Reactor / RxJava3 / Mutiny, Kotlin, TypeScript, Swift). Long operations are sent as a SHA-256 hash with no query text. OnPersistedQueryNotFoundthe client retries once with the text and the same hash, which makes the server register the query. The wire format is the Apollo APQ protocol. See the new Persisted Queries page.- The hash is computed at runtime over the exact string that is sent (fragments and
@glCachepartial-query merges included), with a dependency-free SHA-256 generated into each client. - Operations shorter than about 144 characters are sent normally, since the hash payload would be bigger. Queries and mutations both use it; subscriptions and uploads are unchanged.
- Retries are strict: only
PersistedQueryNotFoundtriggers the full-query request, never timeouts or 5xx responses.PersistedQueryNotSupportedmakes the client send full queries for the rest of its life. - New
persistedQueriesUseGetoption (requirespersistedQueries: "apq") sends hash-only queries over GET through a separategetAdapter. The registering retry and every mutation use POST. A server that refuses GET (405) makes the adapter throw the newGraphLinkGetNotSupported; the client re-sends by POST and remembers. - Behaviour change when enabled: the POST adapter receives payloads without a
queryfield for persisted operations. Adapters that forward the body as-is keep working. WithpersistedQueriesUseGet, the client constructors take agetAdapterright afteradapter(thewithHttp-style convenience constructors wire it for you). - The server has to implement APQ. Apollo Server does; Spring for GraphQL needs a
WebGraphQlInterceptor(and a GET filter forpersistedQueriesUseGet). Bound the server-side cache. - With the option off, generated output is unchanged.
- The hash is computed at runtime over the exact string that is sent (fragments and
-
Client enums tolerate unknown values — new
strictEnumsoption (defaultfalse) on every client language. Adding a value to a server enum used to make already-shipped clients throw while decoding the response. Now each generated client enum gets anunknownValue__member andfromJsonreturns it for any value the schema did not declare. Encoding it back throws (Dart, Java, Kotlin, TypeScript); Swift'stoJson()is non-throwing everywhere, so the fallback encodes as the literal stringunknownValue__and is sent; the server then rejects it as an invalid enum value. An enum that already declaresunknownValue__gets the fallbackunknownValue__2(then3, …), and generator-internal enums never get one. Server mode is unchanged and always strict.- Behaviour change: client enums gain one member, so exhaustive
switch/whenover a generated enum needs a branch for it. Set"strictEnums": trueto keep the previous output.
- Behaviour change: client enums gain one member, so exhaustive
-
Literal arguments in custom queries —
query findUser0 { findById(id: "0") { id } }used to fail withCould not find argument "0", because every argument value was looked up as a declared variable. Only$namevalues are variable references now; anything else is a literal, sent as written and not turned into a method parameter. Literals and variables can be mixed.- Literals are checked against the field's declared argument type at generation time: undeclared argument names, wrong scalar kinds, undeclared enum values, unknown or missing input-object fields, and
nullfor non-null types are all parse errors. - Behaviour change: the same checks now apply to
= valuedefaults on input fields and arguments. Defaults likeInt = "x"orStatus = BOGUSwere accepted before and are now rejected. Custom scalars are not checked.
- Literals are checked against the field's declared argument type at generation time: undeclared argument names, wrong scalar kinds, undeclared enum values, unknown or missing input-object fields, and
Fixes #
- Dart: the generated enum
toJsonno longer has an unreachablebreak;afterthrow. - Java: the Spring WebClient multipart adapter imported
MultipartBodyBuilderfrom the wrong package, so generated Java reactive clients with file uploads did not compile. - Java reactive (Mutiny):
flatMapnow generateschain, as Mutiny's API requires.
6.0.0 - 2026-11-04 #
New features #
- Scalar codecs — a
typeMappingsentry can now be an object,{"type": "Decimal", "import": "package:decimal/decimal.dart", "fromJson": "Decimal.parse({} as String)", "toJson": "{}.toString()"}, so a custom scalar (DateTime,Money, ...) is converted when it is decoded and encoded, in fields, list elements, input fields and operation arguments.{}is the value;importis a string or a list and lands in every generated file that uses the scalar. A string value is still a plain type alias. Either side may be declared alone, and generation fails with a clear message when the schema uses a scalar on a side the codec does not cover (write"toJson": "{}"to pass a value through on purpose) and when a codec scalar has a default value. jsonTypefor Swift scalar codecs — atypeMappingsobject may declare"jsonType": "String" | "Int" | "Double" | "Bool" | "Map" | "List". The Swift generator then reads the field through the checkedgl*helper and passes a value of that type tofromJson, so a template no longer needsas!and anullor wrong-typed value throws aGraphLinkDecodeErrorinstead of trapping. Omit it and the template receives an untyped value, as before. The other targets ignore the key for now.jsonTypefor Go scalar codecs — thejsonTypekey (see the Swift entry) is now read by the Go generator. The field is read with a checked reader (glString,glInt,glFloat64,glBool,glMapAny,glListAny) and the template receives a typed value, sofromJsonneeds no{}.(string)assertion, and anullor wrong-typed value is returned as an error instead of panicking. Omit it and the template receives anany, as before.jsonTypefor TypeScript and Python scalar codecs — thejsonTypekey is now read by the TypeScript and Python generators. TypeScript checks the field withGraphLinkJson.expectString/expectInteger/expectNumber/expectBoolean/expectObject/expectArray(the last two are new ingraph-link-json.ts), sofromJsonneeds noascast that is erased at run time. Python gets a new generatedclient/graph_link_json.py(expect_str,expect_int,expect_float,expect_bool,expect_dict,expect_list, each raising aTypeErrorthat names the field). Anull, missing or wrong-typed value fails and the template never runs; nullable fields keepnull/None. Omit it and the template receives the untyped value, as before.jsonTypefor Dart, Java and Kotlin scalar codecs — thejsonTypekey is now read by the last three client generators, so every client supports it. Dart casts toString/int/num/bool/Map<String, dynamic>/List<dynamic>; Java and Kotlin cast to the boxed type, convertIntexactly to along/Long(BigDecimal.longValueExact) andDoubletodouble/Double, and Java rejectsnullfor a non-null codec. The template no longer needs its own cast. Omit it and the template receives the untyped value, as before.- Go client — new
clientConfig.gotarget. Types, inputs and enums are plain structs and string types withjsontags, generated into one flat package (packageName); nullable scalars, enums and objects are pointers, interfaces and unions are Go interfaces decoded from__typename, and inputs with schema defaults get aNew<Input>()constructor. The client iscontext-aware: every operation returns(value, error)(a*GraphLinkExceptionfor GraphQL errors), optional and defaulted arguments go in a trailing<Operation>Optionsstruct, subscriptions are channels ofGraphLinkEvent[T], and the transport is an injectable function. Includes@glCachewith tag invalidation andstaleIfOffline, file uploads with exact progress reporting,@glCaptureErrors, and persisted queries (APQ, optional GET) with the same wire behaviour as the other clients. Defaultnet/httpadapter andcoder/websocketsubscription adapter with auto-reconnect (httpAdapter/wsAdapter:"none"to bring your own; withwsAdapter: "none"the package imports only the standard library). Requires Go 1.22+. - Python client — new
clientConfig.pythontarget. Types, inputs, interfaces/unions and enums are pydantic v2 models (snake_case fields keeping the wire name as alias,to_json/from_json,__typenamedispatch for interfaces and unions, tolerant enums). The client isasyncio-based: queries and mutations areasyncmethods with keyword-only arguments, subscriptions areAsyncIterators, and the transport is an injectableasyncadapter. Includes@glCachewith tag invalidation andstaleIfOffline, file uploads,@glCaptureErrors, and persisted queries (APQ, optional GET) with the same wire behaviour as the other clients. DefaulthttpxHTTP adapter andwebsocketssubscription adapter with auto-reconnect (httpAdapter/wsAdapter:"none"to bring your own). Requires pydantic >= 2.10. - REST operations (Dart client) — fields of
QueryandMutationannotated with@glRestare served over HTTP/JSON instead of GraphQL, from the same schema and through the same generated client (client.queries.product(...),client.mutations.createProduct(...)). Adoption path from REST to GraphQL: flip a field by removing the directive. Arguments get explicit roles (@glRestPath,@glRestParam,@glRestHeader,@glRestBody,@glRestField,@glRestPart); input objects spread or nest into query strings, headers, forms and multipart;@glRestPrefixshares a path and method across a block; responses can be JSON, text (response: TEXT),Void(scalar Void @glVoid) or a streamedDownload(scalar Download @glDownload); interfaces and unions decode through@glRestDiscriminator.@glCache,@glNoCacheand@glCacheInvalidatework on REST and share the cache and tag space with GraphQL operations; a non-2xx status raisesRestError. The transport is one injectable function (Future<RestResponse> Function(RestRequest)) with generatedpackage:httpand Dio adapters (restHttpAdapter,queryListStyle,formNesting). Seerest-client-specs.md. - REST operations (Java client) —
@glRest*operations are generated for the Java client, blocking and reactive (asyncStyle: ReactorMono, RxJava 3Single/Maybe/Completable, MutinyUni):GraphLinkRestUtilsand theRestRequest/RestResponse/RestError/GLDownloadruntime types,GraphLinkRestResolver, a JDKHttpClientDefaultGraphLinkRestAdapter(restHttpAdapter,queryListStyle,formNesting;"none"to bring your ownGLRestAdapter), discriminated interface/union decoding and named missing-field errors. Operations that upload or download get overloads with a progress callback. See REST operations. - REST operations (TypeScript client) —
@glRest*operations are generated for the TypeScript client too:graph-link-rest.ts(runtime types, helpers),GraphLinkRestResolver, fetch and axios adapters (restHttpAdapter,queryListStyle,formNesting), discriminated interface/union decoding and named missing-field errors. See REST operations. - REST operations (Kotlin client) —
@glRest*operations are generated for the Kotlin client:GraphLinkRest.kt(runtime types, helpers),GraphLinkRestResolver, an OkHttpDefaultGraphLinkRestAdapter(restHttpAdapter,queryListStyle,formNesting), discriminated interface/union decoding and named missing-field errors. See REST operations. - REST operations (Python client) —
@glRest*operations are generated for the Python client:graph_link_rest.py(runtime types, helpers),GraphLinkRestResolver, an httpxGraphLinkRestHttpxAdapter(restHttpAdapter,queryListStyle,formNesting), discriminated interface/union decoding through the pydantic dispatch validator. See REST operations. - REST operations (Swift client) —
@glRest*operations are generated for the Swift client:GraphLinkRest.swift(runtime types, helpers,RestDecode),GraphLinkRestResolver, a URLSessionDefaultGraphLinkRestAdapter(restHttpAdapter,queryListStyle,formNesting), and discriminated interface/union dispatch through the regularfromJson. See REST operations. - REST operations (Go client) —
@glRest*operations are generated for the Go client:graph_link_rest.go(runtime types, ordered value collection),GraphLinkRestResolver, anet/httpGraphLinkRestHttpAdapter(restHttpAdapter,queryListStyle,formNesting), per-operationOptionsstructs, discriminated interface/union decoding andUnmarshalJSONrequired-field errors. See REST operations. - REST operations (Java, WebClient) — with
reactiveHttpClient: "webclient"the generatedDefaultGraphLinkRestAdapternow uses SpringWebClient(it used to be the JDKHttpClientwhatever the setting). Uploads and downloads stream, redirects are followed,gzip/deflateresponses are decoded, and non-2xx responses reach the client asRestError. @glRestNullable— a REST operation marked@glRestNullabledecodes into a generated copy of its response type (ProductgivesProductRest) in which every field is nullable, so an API that omits fields or sendsnullfor fields the schema declares non-null no longer fails the call. The copy is deep and includes the members of interfaces and unions, whose discriminator keeps the original wire values. List elements follow the schema. GraphQL operations and operations without the directive keep the original type. The suffix is the new top-level optionrestNullableSuffix(defaultRest). The directive is rejected on text, binary andVoidresponses, on scalar or enum results and on fields that are not REST operations;@glTypeNameon a REST operation now says so instead of the generic placement error.@glRestNullableon a whole root type, and therestNullableoption —type Query @glRestNullable { ... }(orMutation, or anextend typeblock, which covers its own fields) applies the directive to every REST operation it declares, and the new top-levelrestNullableoption (defaultfalse) applies it to every REST operation in the project. Operations that cannot be copied (text, binary or void responses, scalar or enum results) and plain GraphQL fields are skipped without an error; the directive on such a single operation is still an error, and so is the directive on any type other thanQueryorMutation. Behaviour change when enabled: result types at call sites become<Type>Rest.glink --print-directiveswrites the declarations of every GraphLink directive (generated from the same table the validator uses) so your IDE stops flagging them. The hand-written "copy-paste declarations" block indirectives.mdhad wrong locations for several directives and is replaced by this output.
Breaking changes #
-
Python and Go decode and encode explicitly. Every generated type and input has
to_json/from_json(Python) andToJson/<Type>FromJson(Go), like the other languages, instead of leaving it to pydantic andencoding/json. Pydantic aliases and Go struct tags stay as a fallback. Go'sToJsonreturns an orderedJsonObjectandMarshalJSON/UnmarshalJSONdelegate to the explicit methods. -
A missing non-null field is an error in Go and Python on every type (it was only checked for REST responses in Go). The message names the type and the field.
-
Swift decodes interfaces and unions with
throws. An unknown or absent__typename(and, for REST, an unknown, absent or null discriminator) used to end infatalError, which terminated the app and could not be caught. It now throws aGraphLinkDecodeErrornaming the type and the value. The generatedfromJsonof an interface or union dispatch, and of every type that holds one (directly, in a list, or through other types), isthrows; call it withtry. Client methods are unchanged (client.queries.x()was alreadyasync throws), a bad element of a subscription ends the stream with the error, and thefromJsonof plain types and enums is unchanged. A missing non-null field still traps in Swift (force unwrap). -
Type names that clash with the target language's standard library are renamed — a schema type, input, enum, interface or union called like a type the generated code relies on (
Map,List,Object,Error,Result,Optional,Date, ... depending on the language) used to produce code that did not compile (Map<String, dynamic>resolved to your type). It now gets a trailing underscore in the generated code (Map_); the schema name and the JSON__typenamestay as declared. Go keeps every name. The sets are inlib/src/model/reserved_words.dart(*ReservedTypeNames). -
Directives are validated — every directive in a schema is now checked, both GraphLink's own (
@glCache,@glMapsTo,@glRest, ...) and the ones you declare. Generation fails, with the line and column, when:- a directive that is not built in has no
directive @name ... on ...declaration in your schema; - an argument name is unknown or misspelled (
@glRest(path: "/p", methdo: PUT)used to be accepted and silently ignored), or a required argument is missing; - an argument value has the wrong kind (a string where an
Intis declared, an enum value that does not exist, a list where a scalar is expected); - a directive is used at a location it does not allow (
@glUploadon a type,@deprecatedon a type or union, a user directive declaredon FIELD_DEFINITIONbut applied to an object).
GraphLink's own directives, the standard ones (
@include,@skip,@deprecated,@specifiedBy) and@oneOfare built in and need no declaration. A hand-written declaration of a built-in one is still accepted as long as it only uses arguments the built-in has (plus the annotation argumentsglClass,glImport,glOnClient,glOnServer,glAnnotation).Migration: declare every custom or third-party directive your schemas use (for example federation's
@keyand@link, or your own@auth), and fix the typos and wrong values the new errors point to. Seeplans/directive-validation.mdfor the inventory. - a directive that is not built in has no
-
Conflicting fields in unions and interfaces — GraphQL rejects a selection where a field with the same response name has a different type on two members (
... on Photo { size } ... on Video { size }withsizeanInt!on one and aString!on the other,IntagainstInt!, or a list against a scalar). GraphLink used to generate such selections, so the server rejected the operation at runtime.- A hand-written selection or named fragment that does this now fails generation with the field and both types. Migration: select one of them under an alias (
... on Video { videoSize: size }). ..._all_fieldson a type that reaches such a union or interface now fails the same way.- Auto-generated queries, mutations and subscriptions that reach one are no longer generated. The CLI prints one warning per cause, with the operations skipped and how to fix it: write a custom operation with an alias, or give the fields the same type in the schema. On GitHub's schema this removes 67 operations, all reaching five unions and interfaces whose members disagree (
descriptionHTMLisHTML!onEnterprisebutStringonOrganization). - Operations that spread GraphLink's generated
_all_fields_fragments by name are not checked.
- A hand-written selection or named fragment that does this now fails generation with the field and both types. Migration: select one of them under an alias (
-
Cycle breaking in
_all_fieldsfragments — the edge that is inlined to break a cycle is now chosen the same way for every file order: the traversal starts atQuery,MutationandSubscriptionand visits types and fields by name, and an edge that carries field arguments is cut in preference to the edge that closes the cycle, so the arguments stay reachable. This cuts fewer edges (the GitHub schema goes from 610 to 329). Migration: regenerate; the_all_fields_<Type>fragments of types in a cycle, and the auto-generated operations that spread them, can differ from earlier output (a field is inlined where it used to be spread, or the other way round). -
Projected interface and union names — a selection on an interface or union no longer takes the schema name unless it selects every implementer in full. It is named after the declared type and the fields it declares (
Entity_CreatedById), with a short hash suffix when the same fields are selected over different members (Entity_CreatedById_199d2ij); a union with no common fields is namedAnimal_<hash>instead ofAnimal. Types that implement them are renamed accordingly. Migration: regenerate and update the references to the old interface names (for exampleAnimalbecomesAnimal_<hash>); the generated response types already carry the right type, so code that only readsresponse.fieldkeeps compiling. A selection on an interface that names no implementer (node { id }) now returns an interface with a single implementation and no per-implementer types: code that tested such a result withis Articleno longer compiles; select the implementer (... on Article { ... }) to get the dispatching interface. -
GraphQL transport failures — a GraphQL call whose response has no
dataand no errors, or whose HTTP status is not 2xx without a GraphQL body (a gateway page,{"error": "unauthorized"}), now fails with the same error type as server-side GraphQL errors (GraphLinkExceptionin Java, Kotlin, Python, Go and Swift; theGraphLinkErrorlist in Dart and TypeScript) instead of returningnull/None, throwing a cast error, or crashing the Swift process.GraphLinkErrorhas two new nullable fields,statusandbody, set for HTTP failures. The Dart dio and TypeScript axios adapters no longer throw their own exception on a non-2xx status; they go through the same check.- Breaking (Java, Kotlin):
DefaultGraphLinkClientAdapternow takes aGraphLinkJsonDecoder, likeDefaultGraphLinkGetAdapteralready did, so it can tell a GraphQL response from a gateway page by parsing it. Java:new DefaultGraphLinkClientAdapter(url, decoder),(url, headersProvider, decoder),(url, headersProvider, decoder, httpClient). Kotlin:DefaultGraphLinkClientAdapter(url, decoder, headersProvider, httpClient). TheGraphLinkClientfactory methods are unchanged.
- Breaking (Java, Kotlin):
-
Empty
errorslist — a response such as{"data": {...}, "errors": []}is now a success in Dart, TypeScript and Python, as it already was in the other targets; an empty list counts as no errors, including for cached operations and@glCaptureErrors. -
Exact integers in Java and Kotlin — decoding an
IntorLongfield no longer wraps, clamps or truncates. A value outside the type's range (99999999999999999999999) or with a fraction (19.5) now fails with anArithmeticException; a whole number written as19.0or1e3is still accepted. Migration: none for valid responses; a server that sent out-of-range or fractional numbers for an integer field used to get a wrong value silently and now gets an exception. The other targets keep their language's own integer (64-bit in Dart, Go and Swift, unbounded in Python, a double in TypeScript) and do not range-checkIntto 32 bits; to get another type, declare a scalar with a codec, which bypasses this conversion. -
Run-time type checks in TypeScript — the generated
fromJsonof every type and input, and the result of a REST operation, now check scalars at run time (a new generated fileclient/graph-link-json.ts) instead of casting them withas. A value of the wrong type, a non-integer or unsafe integer for anInt, or a non-finite number for aFloatthrows aTypeErrornaming the field (Product.id: expected string, got number). The check follows the type a scalar is mapped to: anIDmapped tostringaccepts only strings, mapped tonumberaccepts numbers. A scalar with a codec is not checked. Migration: regenerate; a server that sent"19"for anIntused to be accepted and now throws. -
UTF-8 byte order mark — a response body that starts with a BOM (
EF BB BF) is now decoded in Python, Go, Java and Kotlin, as it already was in Dart, TypeScript and Swift. The clients drop the mark from GraphQL bodies and from REST text and JSON bodies; binary downloads are untouched. -
Wrong-typed nullable values in Kotlin — decoding a nullable field, list element or REST result whose JSON value has the wrong type (an array or a string where an object is expected, a number where a string is expected) no longer yields
null. It now throws aClassCastException, as it already did for non-null values and as Java does.nulland absent values are stillnull. Migration: regenerate; a server that sent the wrong type for a nullable field used to getnullsilently and now gets an exception. -
Throwing decoders in Swift — a bad response no longer terminates the process. Every generated
fromJsonnowthrowsaGraphLinkDecodeErrornaming the field (Product.id: missing or null,expected Int, got Bool) instead of trapping onas!, a force unwrap or the NSNumber bridge, and a nullable field with the wrong type throws instead of becomingnil. The checks live in a new generated file,GraphLinkDecode.swift.Intmust be an exact integer: a fraction, an overflow, a string or a boolean throws. An enum generated without an unknown fallback (strictEnums) throws for an undeclared value. An unreadable cache entry or cache tag entry (corrupt JSON, wrong types) is treated as a miss and removed, instead of trapping, and the default GET adapter throwsURLError(.badURL)instead of force-unwrapping the URL. Breaking:fromJsonon every type, input and enum without a fallback is nowthrows; call it withtry. The generated client already does. Migration: regenerate and addtrywhere you callfromJsonyourself.
Fixes #
- Java: a
Longdefault beyond 32 bits (or anyLongdefault) is emitted with theLsuffix;Long total = 9007199254740993;did not compile. - Kotlin subscriptions never ended — a
Flowstayed open after the server completed the subscription and ignored a server error;collectandtoList()hung. The flow now completes oncompleteand fails with aGraphLinkExceptiononerror(and with the cause on a connection failure). - TypeScript subscriptions can observe completion — the callback form gets an optional
onCompleteafteronError, called when the server completes the stream. - Interface selections that mix shared fields with inline fragments —
feed { ...EntityBits ... on Article { title } }only asked for__typenameinside... on Article, so every other implementor reached the generated decoder without one and decoding threw. The selection now requests__typenameat its own level. - Operation names that collide after normalisation — a hand-written
query Photoand the generatedphotoboth became the methodphoto(Dart, Kotlin, Swift, ...) and the code did not compile. Generated operations keep their name, the hand-written one gets a numeric suffix (photo2). Its wire name is unchanged. - A custom operation named like a generated one (
query listUsersnext to the schema fieldlistUsers) failed generation with "has already been declared", pointing at the schema. The custom operation now wins and the generated one is skipped with a warning. - String literals with special characters — a string default or argument value containing
",\,$,${x}, a newline,*/or a unicode escape produced wrong or uncompilable code in every target (the value was pasted between the target's quotes with its GraphQL escapes, and the lexer dropped the backslash of\"and never closed a string ending in\\). The literal is now decoded once and each target writes it with its own escaping, in default values, operation text and@deprecatedreasons. @oneOfinputs — the unused members were sent asnull, which the server rejects. They are now left out of the payload in every target.- Default object values —
= {}or= {n: 9}on an argument whose input type declares its own field defaults left those defaults out in TypeScript and Go; they are now filled in. - Swift recursive inputs and types — a field that holds its own type, directly or through other types (
input Ping { pong: Pong }/input Pong { ping: Ping }), no longer fails to compile; the field is stored behind a box and keeps its public type. - Generated code no longer breaks on a few names — an operation argument or field named
awaitoryield(Dart) and a field namedawait(Swift) now get a trailing underscore like the other reserved words. The JavatoJson()local variable is no longer calledmap, so a field namedmapstays reachable. - Dart uploads (GraphQL and REST) — the
httpand Dio adapters stream multipart and raw uploads lazily (GLMultipartBodyingraph_link_uploads.dart) instead of building them in memory, so progress is real on both. AGLUploadwith nolengthused to fail on GraphQL withContent size exceeds specified contentLengthand was read into memory on REST; it is now sent chunked.onProgressis no longer called when the total size is unknown (REST used to report a total of-1). - Java uploads (GraphQL and REST, blocking and reactive) — the JDK, OkHttp and WebClient adapters stream multipart and raw uploads (a new
GLMultipartBody) instead of building the body in memory; the JDK GraphQL adapter used to copy every file into aByteArrayOutputStream. AGLUploadwith a negativelengthis sent chunked, andonProgressis no longer called when the total size is unknown. OkHttp now reports progress for the whole request body instead of per file, and the WebClient adapter reports progress at all. - Kotlin uploads (GraphQL and REST) — REST multipart no longer reads each file into memory (
readBytes()); file parts are streamed like raw uploads. On both transportsonProgressis no longer called when the total size is unknown, and the GraphQL adapter reports progress for the whole request body instead of per file. - TypeScript uploads (GraphQL and REST) — multipart bodies are streamed lazily (
glMultipartBodyingraph-link-uploads.ts) instead of being assembled in memory. The GraphQL fetch adapter usedFormData, which silently brokeReadableStreamuploads and never reported progress; it now streams and reports progress, falling back toFormDataonly on runtimes without streaming request bodies (Firefox, Safari) forBlob/Fileuploads. The axios REST adapter streams on Node and passesBlob/FormDatato XHR in the browser; it no longer reads raw uploads into memory.onProgressis not called when the total size is unknown. - Python uploads (GraphQL and REST) — the httpx GraphQL adapter streams multipart bodies (
gl_multipart_streamingraph_link_uploads.py, shared with REST) instead of reading every file into memory and reporting fake0andtotalprogress; async-iterable uploads now work over GraphQL, and unknown lengths are sent chunked.on_progressis not called when the total size is unknown (REST used to report-1). - Swift uploads (GraphQL and REST) —
GLUploadis no longer backed by aData. It pulls its bytes lazily from memory (init(data:), unchanged), from disk (newinit(fileURL:)) or from any async sequence (newinit(length:chunks:)), and the multipart and raw bodies are streamed through a boundInputStreamwithURLSessionUploadTask(withStreamedRequest:)instead of being assembled in aData. Progress now reports bytes written to the socket (the default GraphQL adapter used to call it once, at the end);onProgressis not called when the total size is unknown, and an upload of unknown size is sent chunked. Breaking:GLUpload.datais gone (usetry await upload.readAll()), and the publicrestMultipart(_:)helper is replaced byGLMultipartBody. - Go uploads (GraphQL and REST) —
OnProgressis no longer called when the total size is unknown (Length: -1); it used to report a total of-1. A multipart file part without a filename now defaults it to the part name, so the server sees a file rather than a plain form field. - Java reactive REST: cached nullable queries — a
@glCacheREST query with a nullable result no longer fails when the response is empty: with Reactor it threwNullPointerException: The mapper returned a null value, and with RxJava 3 the generated client did not compile (Single<T>returned whereMaybe<T>was declared). They now go through a newrestCachedOrNulland complete empty (ornullwith Mutiny) without caching anything. The blocking client is unchanged. - Interfaces and unions in operations — several selections over interfaces and unions generated wrong or incomplete code:
- an operation that crossed an interface or union edge (
feed,articlein the integration schema) sent only part of the fragments it needs, and the server rejected it withUndefined fragment; - a named fragment on a union or interface (
fragment F on Attachment { ... on Photo { width } }) failed to parse withCould not find field ... on type; - a fragment spread inside an inline fragment (
... on Article { cover { ...F } }) was not sent with the operation; - fields selected through an interface fragment (
... on Entity { createdBy }) were dropped from the implementing types, and... on Entityinside a union selection was rejected. Fragments are now valid when their possible types overlap the parent's (the GraphQL rule); - the Go client emitted the getter of an interface field twice for a type implementing two interfaces (
Article implements Entity & Node), which did not compile; - a type whose nested selection was partial (
post { cover { id } }) took the schema name (Post) and replaced the real type, so another query selectingcoverin full decoded into a class that needed fields the first query never fetched; - two selections of the same interface or union with different members or fields shared one interface, whose
fromJsondispatched a__typenameto one fixed class, so one of the queries lost fields or failed to decode. - the TypeScript client tagged a projected type with its own generated name (
Photo_IdWidth) and dispatched on it, so a union member selected partially never matched the__typenamesent by the server and failed withUnknown Attachment_Id: Photo. Projected types now carry, write and dispatch on the wire__typename(Photo); - an alias on a field below the root of an operation (
gallery { t: title }) producedt:without the field name, so the server rejected the query; aliases inside inline fragments (... on Video { videoSize: size }) were broken the same way; - a selection on an interface that names no implementer (
node(id: $id) { id }) generated a dispatching interface that read__typename, which the operation never asked for, so every call failed to decode (and a Swift app trapped). It now generates an interface named after the declared one (Node_Id) with a single implementation (Node_Id_Impl) that is returned directly, without reading__typename, so an implementer added later by the server cannot break it. The interface was also named after another interface the members implement (Entity_Idfor a query onNode).
- an operation that crossed an interface or union edge (
- Generated code depended on the order of the schema files — a schema with a cycle through a field with arguments (
Article.author→Author.latestArticles(limit: Int!)→Article) generated different clients depending on which file was parsed first, and the file order comes from the filesystem. On Linux CI,getArticle,listArticles,createArticleand the other operations returningArticlelost their<Operation>FieldArgsinput and thefieldArgsparameter, so the same schemas compiled on macOS and failed on the runner. The all-fields fragments are now built the same way whatever the order of the files. - Unparseable
Content-Typein the Java WebClient adapters — a response whoseContent-TypeSpring cannot parse (application/json; charset=nonsense) no longer fails every call withInvalidMediaTypeException. The WebClient-basedDefaultGraphLinkClientAdapter,DefaultGraphLinkGetAdapterandDefaultGraphLinkRestAdapternow wrap theWebClient(including one you pass in) with a generated filter,GLWebClientContentType, that drops the unknown charset, or the header if it still does not parse, so the body decodes as UTF-8 like in the JDK adapters. A header that parses is left alone. - Kotlin: a cancelled or timed-out call is aborted — the OkHttp adapters (GraphQL, GraphQL with upload, GET, REST) ran the blocking
execute()insidewithContext(Dispatchers.IO), which a coroutine cancellation cannot interrupt:job.cancel()orwithTimeoutkept the caller waiting until the server answered, and the socket stayed busy. The adapters now callCall.cancel()when the coroutine is cancelled, so the call stops at once and surfaces as aCancellationException(orTimeoutCancellationException).
6.0.1 - 2026-11-15 #
Fixes #
@glMapsToto a type whose generated name differs from its schema name — a target renamed in the generated code (a type called like a standard-library type, such asErrorbecomingError_) crashed Java generation withNull check operator used on a null value. Kotlin and Swift did not crash but generatedtoError_()with no constructor arguments, which did not compile. The target is now looked up by its schema name.
6.1.0 - 2026-11-15 #
New features #
- Flutter: number inputs accept
3,14and tell the user when a keystroke is refused —intanddoublefields of a generated form only accepted.as the decimal separator: the validator andread()useddouble.tryParse/double.parse, and iOS showed a number keyboard without a decimal key. Everyintanddoublefield now has aNumberInputConfig(new generated filenumber_input_config.dart), passed per field through the form's newnumberConfig(<Input>NumberConfig).- The field never rewrites what the user typed. An input formatter accepts an edit as typed or refuses the whole edit (a pasted
1,234.56included), keeps the text, and shows a short message under the field for two seconds. The message goes away on the next valid edit. The newFormStringsentries arenumberCharNotAllowed,numberOneSeparator,numberTooManyDecimalsandnumberNoNegative; a separator typed into anintfield usesmustBeWholeNumber. - Options:
decimalSeparator(either,dot,comma; defaulteither, which takes one.or one,and never a grouping character, so3,14is always 3.14),locale(accepts grouping in that locale, such as1 234,5in French, and shows initial values in the same format; Latin digits only),allowNegative,maxFractionDigitsandrejectHaptics.doublefields now get a keyboard with a decimal key, andallowNegativecontrols the sign key. - The validator,
read(), the keyboard, and the initial and reset text of a field all use its config. A non-null field whose text cannot be parsed makesread()throwInputReadException(<field>: invalid number) instead of aFormatException. - New top-level
flutter.defaultDecimalSeparatoroption (default"either") sets the default of everyNumberInputConfig. - Behaviour change: typing
1,234in a field with the default config now gives 1.234, not a rejection. UsemaxFractionDigitsor alocalewhen users type thousands separators. - A form without
intordoublefields generates none of this.
- The field never rewrites what the user typed. An input formatter accepts an edit as typed or refuses the whole edit (a pasted
Fixes #
- Flutter: generated enum labels did not compile with
strictEnums: false— thecallmethod of an enum'sLabelsclass switched over every member exceptunknownValue__, which Dart 3 rejects as a non-exhaustive switch. It now returnsnullforunknownValue__, so the field shows the member name, as it does for any enum without a label. WithstrictEnums: truethe output is unchanged. - Flutter: forms without text, enum or bool fields no longer generate the async validation members — the unused
_asyncNotifyingfield (flagged byprefer_final_fields), the guard that read it, and the empty_scheduleAllAsyncValidations()method are left out. - Flutter: guards in generated forms use braces — the
ifguards of the error summary and change handlers (mounted,state == null,errors.isEmpty,!_asyncNotifying, ...) are generated as blocks instead of one-lineifstatements. - Flutter: the time picker follows the date pattern's hour format — a date-time field with a 24-hour pattern (
yyyy-MM-dd HH:mm) showed "Enter a valid time" when the user typed an hour above 12 in the picker's keyboard entry, whenever the app's locale orMediaQuerywas 12-hour (the default en_US, for example). Typing14:30worked or failed depending on the browser's language. The generated pickers now set the hour format from the pattern:Horkselects 24-hour,horKselects 12-hour (quoted text in the pattern is ignored), and a pattern with none of them keeps the platform setting. This applies to the Material time picker and to the Cupertino date picker (use24hFormat), in dialog and inline mode. - Spring: a repository on a renamed type uses the generated name —
@glRepository(glType: "Supplier")on a type whose name is reserved (SupplierbecomesSupplier_in Java,ResultbecomesResult_in Kotlin) generatedextends JpaRepository<Supplier, String>next to theSupplier_import. The type argument now uses the generated name; the schema keeps the original name inglType.
6.1.1 - 2026-11-27 #
Fixes #
- Flutter:
unknownValue__was offered as a choice in generated forms — withstrictEnums: false(the default) every enum has a fallback member,unknownValue__, for wire values the client does not know. The input forms listedEnum.values, which includes it, so the dropdown, choice chips, radio group, checkbox list and filter chips all showedunknownValue__as something the user could pick. The forms now list only the members the schema declares, in the schema's order. WithstrictEnums: truethe output keeps the same choices. - Note on
strictEnums: false— the fallback addsunknownValue__to every generated Dart enum, so an exhaustiveswitchover a generated enum in your own code needs a case for it (or a default).