Skip to content

graphqlcodegen-maven-plugin-3.5.0

Choose a tag to compare

@deweyjose deweyjose released this 18 Jun 01:56
· 24 commits to main since this release

What's Changed

  • Bump org.jetbrains.kotlin:kotlin-reflect from 1.9.23 to 2.1.21 by @dependabot in #229
  • Bump org.mockito:mockito-core from 5.2.0 to 5.18.0 by @dependabot in #249
  • Bump org.apache.maven:maven-plugin-api from 3.9.9 to 3.9.10 by @dependabot in #250
  • Bump com.graphql-java:graphql-java from 24.0 to 24.1 by @dependabot in #251

Full Changelog: graphqlcodegen-maven-plugin-3.4.0...graphqlcodegen-maven-plugin-3.5.0

Version 3.5.0 introduces schema transformation for DGS Client compatibility

This release adds automatic transformation of custom root type names to standard GraphQL types, solving compatibility issues when working with remote GraphQL servers that use non-standard root type names.

The Problem

Many GraphQL servers use custom root type names like CustomQuery, CustomMutation, or CustomSubscription instead of the standard Query, Mutation, and Subscription. While this works fine for server-side operations, DGS Client codegen expects standard root type names and fails to generate client code for these schemas.

The Solution

The plugin now automatically transforms custom root types to their standard equivalents during code generation:

# Remote server schema (custom root types)
schema {
    query: CustomQuery
    mutation: CustomMutation
    subscription: CustomSubscription
}

type CustomQuery {
    hello: String
}

# Generated client code (standard root types)
type Query {
    hello: String
}

Key Benefits

  • Seamless DGS Client integration - Generate working client code from any GraphQL schema
  • No server changes required - Works with existing remote servers that use custom root types
  • Transparent transformation - The GraphQL operations sent over the wire maintain the expected shape for the server
  • Backward compatible - Existing schemas with standard root types continue to work unchanged

When to Use

This feature is primarily useful for client-side code generation when connecting to remote GraphQL servers that use custom root type names. The transformation ensures DGS Client can generate compatible code while preserving the original schema structure for server communication.