graphql-java-generator / graphql-maven-plugin-project

graphql-maven-plugin is a Maven Plugin for GraphQL, based on graphql-java. It accelerates the development for both the client and the server, by generating the Java code. It allows a quicker development when in contract-first approach, by avoiding to code the boilerplate code.
https://graphql-maven-plugin-project.graphql-java-generator.com
MIT License
118 stars 47 forks source link

Spring 6 - missing createError() method in OAuthTokenExtractor.GetOAuthTokenClientResponse implementing spring reactive ClientResponse #189

Closed capdav closed 1 year ago

capdav commented 1 year ago

Hello Etienne,

Seems there is an issue with what is generated for Spring 6 in public static class GetOAuthTokenClientResponse implements ClientResponse

We have the following exception: com.graphql_java_generator.client.OAuthTokenExtractor.GetOAuthTokenClientResponse is not abstract and does not override abstract method createError() in org.springframework.web.reactive.function.client.ClientResponse

Do you confirm?

Thanks, DAvid

etienne-sf commented 1 year ago

I confirm I encountered it. But I thought it was solved. I'll check that.

Are you using the 2.0 version of the plugin ?

Etienne

capdav commented 1 year ago

Ok thanks for the confirmation ;-)

Yes, we are using the 2.0 version

etienne-sf commented 1 year ago

Hello,

I added the oauth2 capability to the forum sample (provided in the maven plug-in project). It works.

Are you using the ´OAuthTokenExtractor´ class from a copy/paste, or from the plug-in runtime ?

Étienne

capdav commented 1 year ago

Hello Etienne,

From the plug-in generated classes ;-)

etienne-sf commented 1 year ago

If you set the plug-in parameter ´copyRuntimeSources´ to false (which is its default value), then it works!

The ´createError()´ method is not used. So this issue occurs if the code is compiled with a spring framework 6 version. And the runtime is currently compiled against a 5 version.

It will be solved in the next version.

Étienne

etienne-sf commented 1 year ago

Solved in the 2.1 release

capdav commented 1 year ago

Great! Thanks a lot Etienne.. Sorry for my late reply