Skip to content

Release 2.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 10 Aug 18:42
· 47 commits to main since this release

Viaduct 2.0.0 is a major release. The headline work is named fragments and pre-validated GraphQL operations , tenant-local fields supporting better encapsulation, @parent supporting access to fields of parent object, and a settings-topology Gradle model for multi-project builds (as well as on-going work on selective resolvers and the Java Tenant API).

Two changes affect every consumer's build regardless of what else they use: the published artifact set is now fat JARs only (no BOM) and Gradle project plugins now require explicit import of Viaduct modules. Start with Breaking Changes below.


Breaking Changes

Build and packaging — affects every consumer

  • Thin JARs and the BOM are no longer published; all consumers move to fat JARs (364f479) by @nmarsolliercom.airbnb.viaduct:bom and the 22 core/* thin-JAR coordinates no longer resolve.
  • The five com.airbnb.viaduct.shared:* thin JARs are no longer published (graphql, viaductschema, apiannotations, invariants, utils) — they are bundled inside the fat JARs and plugin JARs instead; service:api's POM was cleaned up (4e59880) by @nmarsollier — a build naming these fails at dependency resolution, not compilation.
  • Gradle project plugins now require a settings-declared topology (6aa74ca) by @rstata — module plugins validate that the project is declared as a module in topology before wiring.
  • The project-level package DSL was removed (442c881) by @rstata
  • Schema extension correctness is now enforced, and validateViaductSchemaExtensions was added (a675d8d) by @gokhan-ozgozen — previously-tolerated schema extensions now fail the build.

Service and tenant API

  • The Viaduct execution API was redesigned around Kotlin and Java idioms (0b6914f) by @geovannefduarteViaduct.execute / executeAsync signatures changed; SchemaId.Full was removed.
  • Tenant bootstrapper APIs were renamed (c0cdf7a) by @andimarekTenantAPIBootstrapper, TenantAPIBootstrapperBuilder, TenantModuleBootstrapper, SharedTenantModuleBootstrapper and NaiveTenantModuleBootstrapper are all gone from the public surface.
  • Scanner-based tenant bootstrappers were removed (6145a78) by @junjinp
  • The Java tenant API replaced classpath-scanning bootstrap with the file-based execution registry (74b8b7a) by @catacraciun
  • ViaductBuilder.withScopedSchemasFromSdl replaces the public withSchemaConfiguration (1454821) by @geovannefduartewithSchemaConfiguration and withTenantModuleBootstrapper were removed.
  • Schema scoping configuration is now explicit (8421bae) by @andimarekSchemaScopeInfo was removed.
  • The Selections annotation moved to the new viaduct.api.documents package (981db90) by @kristilekaviaduct.api.select.Selections no longer exists. Part of the 2.0 API package reorganization.
  • GlobalIDCodec.deserialize now has a named return type instead of Pair (e35fe07) by @geovannefduarte
  • FlagManager singleton objects were renamed to UpperCamelCase (1323429) by @geovannefduarteFlagManager.default / FlagManager.disabled are now Default / Disabled.
  • Service factories and constants are exposed via @JvmStatic, and the service API was reshaped for Java callers (9ba69a3, 228fa35) by @geovannefduarte — note for Java callers: the GraphiQL helper's JVM class is now GraphiQLHtml, not GraphiQLHtmlKt. The functions themselves are unchanged; Kotlin callers are unaffected.
  • TemporaryBypassAccessCheck SPI was retired in favour of a static engine config flag (834e009) by @amity177
  • FlagManager.Flags.EXECUTE_ACCESS_CHECKS was removed; access checks now run unconditionally (2fed150) by @amity177

Engine SPI — affects advanced integrators

  • resolveSelectionSetSync was renamed to resolveSelectionSet, the backward-compatibility shim was deleted, and the async path plus ProxyEngineObjectData were removed (108134a, c72ecde, 42ace57) by @vickeyyeh
  • DataFetchingEnvironment was removed from node instrumentation params (b991d9e) by @jbellenger
  • instrumentFetchSelection and shouldInstrumentFetchSelections were removed (d8bd388) by @vickeyyeh
  • objectValue / queryValue were removed from FieldResolverExecutor.Selector (b6a4e36) by @vickeyyeh
  • Selective OER keys were removed (6e9e0b8) by @jbellenger

Experimental — x/remoteresolvers, not covered by the API stability contract


Features

Named fragments and pre-validated GraphQL operations

  • Tenant-facing API surface for named GraphQL fragments and pre-validated operations — first phase of the Named Fragments RFC (ff51065) by @kristileka
  • @GraphQLOperation strings are executable at the tenant boundary with no engine change (f66a3c2) by @kristileka
  • Every declared @GraphQLOperation is schema-validated at assembly time, so an invalid operation fails the build instead of failing at runtime (1cdeb38) by @kristileka
  • KSP codegen plumbing for @GraphQLOperation (QueryFromAnnotation / MutationFromAnnotation) (82b76bc) by @kristileka
  • Propagation and validation layer for @GraphQLFragment (f4b0036) by @kristileka
  • Two assembly-time validations for @GraphQLFragment, closing a gap where an invalid fragment could reach runtime undetected (9978d5c) by @kristileka
  • End-to-end contract tests for @GraphQLOperation (1362350) by @kristileka
  • ctx.query/ctx.mutation taking a selection string are now deprecated — they accept a string that can be invalid and unsafe. The overloads taking an OperationFromAnnotation are the new stable API (aaa3dc7) by @kristileka
  • @GraphQLOperation docs, Star Wars demoapp examples and example-tenant examples (27b719d) by @kristileka
  • A type-safe public way for tenants to check whether an input or argument field was explicitly provided rather than left unset (c8cf50e) by @kristileka
  • @oneOf (exactly one field set) is enforced at the builder level in both the Java and Kotlin tenant APIs (022cdcc) by @catacraciun
  • Two new Viaduct tenant tutorials, continuing the series after tutorial 13 (887dd86) by @kristileka

Tenant-local fields, @parent fields and schema scoping

  • Tenant-local base schema support (0e074c4) by @andimarek
  • Schema-backed @parent fields in resolver and checker required selection sets (574d19a) by @andimarek
  • Build-time validation for schema-backed @parent fields (b75aa2d) by @andimarek
  • Enforce tenant-local RSS ownership (7ecddce) by @andimarek
  • SchemaScoping data class and DSL accumulation surface (#367) by @183565386+xyu307
  • Validate the viaductApplication schema-scoping DSL (#393) by @183565386+xyu307
  • NodeInterfaceIdConsistencyRule for schema validation (369c21f) by @gokhan-ozgozen
  • Require resolvers for argument fields (fbbef96) by @andimarek
  • Make base schema registration explicit (c7af237) by @andimarek

Gradle settings topology and build plugins

Selective resolvers

Background: discussion #399. Gated behind ENABLE_MAT_RESOLUTION and expected to have no production impact until enabled.

  • Selective field resolvers (cfdcf46) by @jbellenger
  • Selective node resolvers (63e7801) by @jbellenger
  • An SPI for field selectivity, integrated into how selective fields are discovered at runtime (ebdd3be) by @jbellenger
  • or combinator for FieldSelectivityProvider (46df1ab) by @alexanderuv
  • Materialization layer interfaces, including the mergeable KeyTree selection-set representation (9581ebb) by @jbellenger
  • MatLedger implementation, tracking which parts of a KeyTree have been materialized (7f86755) by @viaduct-maintainers
  • QueryPlan-to-KeyTree projection and filtering (9b2939a) by @jbellenger
  • ExecutionSelectionSet, an EngineSelectionSet backed directly by the executing QueryPlan (4f199fe) by @jbellenger
  • Preserve child-plan execution context and keep selection traversal within its concrete parent scope — two correctness fixes needed for selective resolvers (1aa154b) by @jbellenger
  • Configurable batching and determinism (8944647) by @jbellenger
  • Normalized child plans (b9a45ee) by @jbellenger
  • Even lazier field-type child plans (36de325) by @jbellenger

Java tenant API

  • Connections and pagination for the Java tenant API (e6be8ad) by @catacraciun
  • Named fragments and typed GraphQL operations in the Java tenant API (06b8652) by @catacraciun
  • Root field references in the Java tenant API (b60f380) by @catacraciun
  • Type-safe Java input-field presence checks (f7799fa) by @catacraciun
  • Complete Java scalar type mappings (7dd836c) by @catacraciun
  • Generate Java GRT reflection metadata (54902b4) by @catacraciun
  • Typed GlobalID<T> support in Java GRT codegen for @idOf-annotated fields (9cfdb13) by @catacraciun
  • --applied_scopes support in the Java GRT/resolver codegen (ff3f740) by @catacraciun
  • Thread an immutable InternalContext through Java tenant-API GRT constructors, mirroring Kotlin (91dd817) by @catacraciun
  • TenantModuleInjectorFactory is implementable from Java (252a4cc) by @geovannefduarte
  • Extract JavaEngineContextDelegate to de-duplicate the Java runtime contexts (5b2c7d0) by @catacraciun
  • Share Tenant API input-value normalization via a new tenant-runtime-support module (f4a2fae) by @catacraciun
  • Share Viaduct runtime variable-decoding helpers across the Java and Kotlin tenant APIs (413bc95) by @catacraciun
  • Converge the Java Viaduct runtime onto the shared variable-decoding helpers (972bb80) by @catacraciun
  • Shared language-neutral SchemaAnalysis in shared/codegen; Java codegen delegates to it (6fccb83) by @catacraciun
  • Kotlin codegen schema predicates delegate to shared SchemaAnalysis (7d52b98) by @catacraciun
  • Centralize resolver class and arguments-type naming in SchemaAnalysis (d5ea7ef) by @catacraciun
  • Golden-output characterization tests for Java and Kotlin GRT/resolver codegen (1c4eb8e) by @catacraciun
  • Extend Java tenant API contract-test coverage across error handling, field resolvers, subqueries, mutations, variables and default node resolvers (f07b728) by @catacraciun
  • Unify the Kotlin and Java feature-app contract test plugins into one bilingual plugin (906dd53) by @catacraciun

File-based bootstrapping and hotswap

  • File-based bootstrapping, part 1: new ModuleConfigSource abstraction (601d8fc) by @kristileka
  • File-based bootstrapping, part 2: orchestration and compatibility (68c7426) by @kristileka
  • File-based bootstrapping, part 3: classic and shims file-based refactor (536b2db) by @kristileka
  • Bootstrap scanner tenants with registry config (47e385a) by @pclowes
  • Filesystem execution registry sources for code hotswap (ea988a1) by @njlynch
  • Tenant-scoped bytecode for local schema hotswap (78a1ca8) by @njlynch
  • Named stream-backed executor registry configs (40677f2) by @rstata
  • EngineTestModule for the runFeatureTest execution-registry path (38fb756) by @rstata

Remote resolvers (experimental)

Property-based testing

Engine, instrumentation and tooling


Bug Fixes

Schema validation and scoping

Execution and engine correctness

Build plugins, bootstrap and codegen


Performance Improvements


Documentation


Testing


Refactoring


Build System


Continuous Integration


Chores

  • Restore @VisibleForTest annotations that were selectively reverted (647dad7) by @nmarsollier
  • Migrate to OWNERS files (83f9a78) by @viaduct-maintainers