spring-projects / spring-graphql

Spring Integration for GraphQL
https://spring.io/projects/spring-graphql
Apache License 2.0
1.52k stars 300 forks source link

GraphqlAutoConfiguration Dependency issue with 1.3.0 and Spring Boot 3.2.1 #1015

Closed sgrannan closed 3 months ago

sgrannan commented 3 months ago

We need to update to the 1.3.0 version to utilize the keep-alive functionality, but when I upgraded only our Spring GraphQL library from 1.2.6 to 1.3.0, I now get a depenency issue. I didn't see where there was a breaking change or that 1.3.0 is requiring a Spring Boot version upgrade? We are currently on Spring Boot 3.2.1

Here is the error I'm now getting on the GraphqlAutoConfiguration

`The following method did not exist:

'org.springframework.graphql.execution.DataFetcherExceptionResolver org.springframework.graphql.data.method.annotation.support.AnnotatedControllerConfigurer.getExceptionResolver()'

The calling method's class, org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration, was loaded from the following location:

jar:nested:/Users/sgrannan/Documents/GitHub/meridian-sockets/target/meridian-sockets-0.0.1-SNAPSHOT.jar/!BOOT-INF/lib/spring-boot-autoconfigure-3.2.1.jar!/org/springframework/boot/autoconfigure/graphql/GraphQlAutoConfiguration.class

The called method's class, org.springframework.graphql.data.method.annotation.support.AnnotatedControllerConfigurer, is available from the following locations:

jar:nested:/Users/sgrannan/Documents/GitHub/meridian-sockets/target/meridian-sockets-0.0.1-SNAPSHOT.jar/!BOOT-INF/lib/spring-graphql-1.3.0.jar!/org/springframework/graphql/data/method/annotation/support/AnnotatedControllerConfigurer.class`

My relevant Spring Boot dependencies...

`

org.springframework.boot
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.2.1</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
org.springframework.boot spring-boot-starter-webflux org.springframework.boot spring-boot-starter-actuator org.springframework.boot spring-boot-starter-data-jpa org.springframework.boot spring-boot-starter-data-redis org.springframework.boot spring-boot-starter-security org.springframework.boot spring-boot-starter-websocket org.springframework.graphql spring-graphql 1.3.0 ` What's the required Spring Boot version for 1.3.0 now?
bclozel commented 3 months ago

It's not technically a breaking change, but really a binary incompatible change that breaks Spring Boot because it's compiled against 1.2.x. This change has been introduced in 038217a6864. This is expected for a minor version.

If you'd like to use Spring for GraphQL 1.3.0, you will need to upgrade to Spring Boot 3.3.0+.

sgrannan commented 3 months ago

@bclozel Thanks for the quick response! I know some who might disagree but I will say that it would have been nice to see this noted in the release notes at the very least. As you know, upgrading Spring Boot minor versions can have impacts elsewhere besides just the one library for many of us who use multiple spring libs. Since it can have impacts for the level of effort of an upgrade being that the parent now must bump as well, I have seen other libs note something like this before or at least make it more obvious.

bclozel commented 3 months ago

Thanks for your feedback. I'm not sure that stating in our release notes that our codebase ships new methods and might be binary incompatible in some parts is really helpful. It's unfortunate that Spring Boot won't work here but we don't guarantee forward compatibility in Spring libraries nor support this case in general.

If your application really requires this new feature, then the upgrade guide could give you a sense of what it would take to upgrade.