spring-projects / spring-graphql

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

Newest version of graphql-java (Version 22) incompatibility #971

Closed cepoiubogdan-query-labs closed 2 months ago

cepoiubogdan-query-labs commented 2 months ago

Is the current version of spring-graphql compatible with the qraphql-java (Version22)? after the upgrade to the latest version i receive the following error: Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.graphql.data.pagination.ConnectionFieldTypeVisitor.visitGraphQLFieldDefinition(ConnectionFieldTypeVisitor.java:88)

The following method did not exist:

'graphql.schema.DataFetcher graphql.schema.GraphQLCodeRegistry$Builder.getDataFetcher(graphql.schema.GraphQLFieldsContainer, graphql.schema.GraphQLFieldDefinition)'

The calling method's class, org.springframework.graphql.data.pagination.ConnectionFieldTypeVisitor, was loaded from the following location:

jar:filepath_to_file/.m2/repository/org/springframework/graphql/spring-graphql/1.2.6/spring-graphql-1.2.6.jar!/org/springframework/graphql/data/pagination/ConnectionFieldTypeVisitor.class

The called method's class, graphql.schema.GraphQLCodeRegistry$Builder, is available from the following locations:

jar:file:path_to_file/.m2/repository/com/graphql-java/graphql-java/22.0/graphql-java-22.0.jar!/graphql/schema/GraphQLCodeRegistry$Builder.class

The called method's class hierarchy was loaded from the following locations:

graphql.schema.GraphQLCodeRegistry.Builder: file:path_to_file/.m2/repository/com/graphql-java/graphql-java/22.0/graphql-java-22.0.jar

Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.graphql.data.pagination.ConnectionFieldTypeVisitor and graphql.schema.GraphQLCodeRegistry$Builder

bclozel commented 2 months ago

The current 1.2.x generation is not compatible with GraphQL Java 22. We don't usually support forward compatibility, especially for breaking changes. Spring for GraphQL 1.3.0 supports 22.x and will be released next week. Would upgrading to 1.3.0 work for you?

cepoiubogdan-query-labs commented 2 months ago

Hello! I think so, yes!

rstoyanchev commented 2 months ago

I'm closing this as there is nothing further to do. Note that the specific issue above is actually due to a GraphQL Java 21 compatibility issue, which is now fixed in #974. For GraphQL Java 22, you need Spring for GraphQL 1.3 still.