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
115 stars 47 forks source link

different configurations for individual schema schema files #178

Closed johannoikonomou closed 1 year ago

johannoikonomou commented 1 year ago

Hi!

I'd like to define different configurations (especially packageName) for specific schema files. I tried defining multiple executions with different schemaFileFolder configs (i also tried playing around with schemaFilePattern) to differentiate between schema files. However after the 1st execution the plugin always says:

The GraphQL schema file(s) is(are) older than the generated code. The code generation is skipped.

There is the skipGenerationIfSchemaHasNotChanged parameter but i believe it's deprecated.

Is there a way to achieve my desired behavior - full disclosure i'm a maven newbie...

Thanks!

etienne-sf commented 1 year ago

Hello,

You should take a look at this pom.xml file. It contains three executions, with different target folders and package names.

The issue you encounter, is that the files are all generated in the same target folder. So, starting from the second execution, the plug-in thinks the files have already been generated.

Please note that you should use the ´springBeanSuffix´ parameter, to make it work properly. This allows to properly differentiate the spring beans.

Étienne

johannoikonomou commented 1 year ago

That makes sense, i'll check out the example. Thank you very much @etienne-sf

johannoikonomou commented 1 year ago

it works :)