graphlink 4.2.0
graphlink: ^4.2.0 copied to clipboard
GraphLink is a powerful code generation tool that generates type-safe client and server code from GraphQL schemas for Dart, Java, Spring Boot and more.
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.)