graphqlcodegen icon indicating copy to clipboard operation
graphqlcodegen copied to clipboard

Question: How to integrate with IntelliJ Idea for automatic code regeneration on branches switch?

Open MateuszStefek opened this issue 6 months ago • 0 comments

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>

MateuszStefek avatar Aug 29 '24 05:08 MateuszStefek