dgs-framework: bug: 5.4.0 does not properly upgrade grapqhl-java to 19.0

Considering the release notes, it should be upgraded to 19.0, but for me it is still on 18.3, leading to issues like.

  • Gradle 7.5.1
  • Java 17
  • netflix dgs 5.4.0
  • spring boot 2.7.4
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [graphql.schema.GraphQLSchema]: Factory method 'schema' threw exception; nested exception is java.lang.NoSuchMethodError: 'graphql.schema.idl.RuntimeWiring graphql.schema.idl.RuntimeWiring.transform(java.util.function.Consumer)'
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
	... 78 more
Caused by: java.lang.NoSuchMethodError: 'graphql.schema.idl.RuntimeWiring graphql.schema.idl.RuntimeWiring.transform(java.util.function.Consumer)'
	at com.apollographql.federation.graphqljava.Federation.ensureFederationDirectiveDefinitionsExist(Federation.java:194)
	at com.apollographql.federation.graphqljava.Federation.transform(Federation.java:67)
	at com.netflix.graphql.dgs.internal.DgsSchemaProvider.computeSchema(DgsSchemaProvider.kt:184)
	at com.netflix.graphql.dgs.internal.DgsSchemaProvider.schema(DgsSchemaProvider.kt:122)
	at com.netflix.graphql.dgs.autoconfig.DgsAutoConfiguration.schema(DgsAutoConfiguration.kt:206)

Currently using this to fix that

dependencyManagement {
    dependencies {
        // FIXME: Fixing open CVEs - remove when the transitive dependencies have been updated
        dependency "org.yaml:snakeyaml:1.33"
        dependency "net.datafaker:datafaker:1.6.0"
        dependency "com.google.protobuf:protobuf-java:3.21.7"
        dependency "com.graphql-java:java-dataloader:3.2.0"
       	// Fix netflix dgs graqphl java update
        dependency "com.graphql-java:graphql-java:19.2"
        dependency "com.graphql-java:graphql-java-extended-scalars:19.0"
    }
}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 26 (10 by maintainers)

Most upvoted comments

Hi…

In my maven SB 2.7 project I cannot control the bom order (I get Spring from parent) but adding this property will override the graphql-java version for maven users…

    <properties>
        <graphql-java.version>19.2</graphql-java.version>
    </properties>

In maven you need to order the dependency mgmt with DGS above Spring boot:

  <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.netflix.graphql.dgs</groupId>
                <artifactId>graphql-dgs-platform-dependencies</artifactId>
                <!-- The DGS BOM/platform dependency. This is the only place you set version of DGS -->
                <version>5.5.1</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

This appears to be working…2.7.8 & 5.5.1. When I had the DSG entry after, it would pull the v18 version from spring boot. Since this is a multi-module system I’m not super happy with this, but it’s optional at this point.

This is still a problem with Maven. Can we re-open this ticket?

This still appears to be a problem. Using DGS version 5.4.3 with Spring Boot 2.7.5. Using Maven, not Gradle.

mvn dependency:tree

returns

...
|  +- com.netflix.graphql.dgs:graphql-dgs-client:jar:5.4.3:compile
|  |  +- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.4:compile
|  |  \- com.graphql-java:graphql-java:jar:18.3:compile
|  |     +- com.graphql-java:java-dataloader:jar:3.1.2:compile
|  |     \- org.antlr:antlr4-runtime:jar:4.9.3:runtime
...

This is the only place in the dependency tree that com.graphql-java:graphql-java appears. v19.2 is nowhere to be seen. I tried clearing out the .m2 directory as well. Still pegged to 18.3. I’d prefer not adding an exclusion if possible so that dependent libraries can be kept in sync more easily for version upgrades.

We’ll need to update our codegen to also use the latest graphql-java version. Will update and do a release.

We have a working example of Spring Boot 2.7 with DGS 5.5.1 here: https://github.com/Netflix/dgs-examples-java-2.7

On Wed, Jan 25, 2023 at 3:02 PM SquireOfSoftware @.***> wrote:

  1. DGS 5.5.x relies on Spring Boot 2.7 and should work with JDK 8. 11 and 17

@srinivasankavitha https://github.com/srinivasankavitha Oh interesting! My project was Spring Boot 2.7.3, JDK 17 and it seemed only DGS 5.3.0 worked for it, anything higher seemed to fail

— Reply to this email directly, view it on GitHub https://github.com/Netflix/dgs-framework/issues/1281#issuecomment-1404335967, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ5JPXLXSDJ6NMLLLJ6VVV3WUGWIJANCNFSM6AAAAAARIXRKB4 . You are receiving this because you were mentioned.Message ID: @.***>

  1. DGS 5.5.x relies on Spring Boot 2.7 and should work with JDK 8. 11 and 17

@srinivasankavitha Oh interesting! My project was Spring Boot 2.7.3, JDK 17 and it seemed only DGS 5.3.0 worked for it, anything higher seemed to fail.

EDIT: 🤣 🤣 maybe I am an outlier

This is still a problem with Maven. Can we re-open this ticket?