dgs-framework icon indicating copy to clipboard operation
dgs-framework copied to clipboard

feature: support Spring Boot 3.0.0-M2

Open pgrosslicht opened this issue 2 years ago • 1 comments

Expected behavior

Fully work in a Spring Boot 3.0.0-M2 project.

Actual behavior

GraphiQL autoconfiguration prevents Spring Boot from starting, DgsDataLoaders don't get picked up.

Steps to reproduce

  1. Create a plain Spring Boot 3.0.0 project (https://start.spring.io/#!type=gradle-project&language=kotlin&platformVersion=3.0.0-M2&packaging=jar&jvmVersion=17&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo)
  2. Add Netflix DGS Spring Boot Starter to dependencies: implementation("com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:4.9.24")
  3. Start application and notice it failing to start with the following error:
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na]
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na]
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[na:na]
	... 34 common frames omitted

As described here, Spring has migrated all Java EE APIs from javax to jakarta, so usages would need to be adapted.

While Spring Boot 3.0.0's general availability is planned for November 2022, I think it still might be important on how this will be handled.

pgrosslicht avatar Mar 30 '22 10:03 pgrosslicht

Thanks for bringing this up and trying it out. We are aware of the upcoming release, and will be planning to update the framework later this year to Spring Boot 3.0.0.

srinivasankavitha avatar Mar 30 '22 17:03 srinivasankavitha

Confirming that this issue is still present in 3.0.0 and 3.0.1. Have a project with a graphql autoconfig that fails to initiate on startup due to missing graphql.GraphQL condition. Reverting springboot version to a previously working version [2.5.5] fixes the issues, so I believe I'm experiencing the same thing

Steps to Reproduce

  1. Create new springboot 3.0.[0-1] project using spring initializer
  2. Add apollo graphql plugin (id("com.apollographql.apollo") version "2.5.11")
  3. Create @Configuration class and attempt to provide ApolloClient bean via autoconfiguration

Startup will fail due to uninitialized graphql instance

Screen Shot 2023-01-06 at 8 45 34 AM

sweller999 avatar Jan 06 '23 16:01 sweller999

We have a candidate branch we are currently testing out and will be ready for release in the next couple weeks: spring-boot-3-candidate. This thread has updates as well: https://github.com/Netflix/dgs-framework/issues/1340

srinivasankavitha avatar Jan 09 '23 18:01 srinivasankavitha

I will close this issue in favor of the other one that is a duplicate.

srinivasankavitha avatar Jan 09 '23 18:01 srinivasankavitha