graphqlcodegen
graphqlcodegen copied to clipboard
Question: How to integrate with IntelliJ Idea for automatic code regeneration on branches switch?
W use the following plugin configuration. Everything works great, incremental compilation works fine.
However, whenever one developer modifies the code and another developer pulls the changes, they need to remember to run a mvn build, as the sources aren't automatically regenerated.
Is there a way to configure IntelliJ IDEA to automatically regenerate sources when the .graphqls
files change?
<plugin>
<groupId>io.github.deweyjose</groupId>
<artifactId>graphqlcodegen-maven-plugin</artifactId>
<version>1.50</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaPaths>
<param>src/main/resources/schema/schema.graphqls</param>
<param>src/main/resources/schema/schema.foobar.graphqls</param>
</schemaPaths>
<packageName>foobar.graphql.schema</packageName>
<outputDir>${project.build.directory}/generated-sources/java/graphql/generated</outputDir>
[...]
</configuration>
</plugin>