aoudiamoncef / apollo-client-maven-plugin

Generate a Java/Kotlin GraphQL client based on introspection data and predefined queries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Migration missed Getters and Builder as default builder

mikkezavala opened this issue · comments

Migrating from:

<plugin>
				<groupId>com.github.aoudiamoncef</groupId>
				<artifactId>apollo-client-maven-plugin</artifactId>
				<version>4.0.5</version>
				<executions>
					<execution>
						<id>generate</id>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<services>
						<api>
							<enabled>true</enabled>
							<addSourceRoot>true</addSourceRoot>
							<sourceFolder>${project.basedir}/src/main/resources/graphql</sourceFolder>
							<schemaPath>${project.basedir}/src/main/resources/graphql/schema.json</schemaPath>
							<includes>
								<include>**/*.graphql</include>
							</includes>
							<compilationUnit>
								<name>full-service</name>
								<outputDirectory>
									${project.build.directory}/generated-sources/graphql-client/myService/
								</outputDirectory>
								<compilerParams>
									<rootPackageName>com.myservice</rootPackageName>
									<generateOperationOutput>true</generateOperationOutput>
									<suppressRawTypesWarning>false</suppressRawTypesWarning>
									<useSemanticNaming>true</useSemanticNaming>
									<nullableValueType>JAVA_OPTIONAL</nullableValueType>
									<generateModelBuilder>true</generateModelBuilder>
									<useJavaBeansSemanticNaming>true</useJavaBeansSemanticNaming>
									<generateKotlinModels>false</generateKotlinModels>
									<generateVisitorForPolymorphicDatatypes>
										false
									</generateVisitorForPolymorphicDatatypes>
								</compilerParams>
							</compilationUnit>
						</api>
					</services>
				</configuration>
			</plugin>

to 5.0.0 and apolo 3.x.x Optional was lost, or not sure how to make it work :/

Previously Getter and Builders where generated but not sure how to do it now.

Thanks

Hi @mikkezavala

There is a lot of breaking changes in Apollo 3.x.x and missing features.

IMHO, you could open an issue in Apollo Kotlin and link back to this issue.

Hi all 👋 Apollo maintainer here. Apollo 3 is indeed a big change focused at making it easier to consume GraphQL from Kotlin. Unfortunately, this change had some unfortunate consequences for the Java codegen as you found out here. Sorry for the inconvenience.
We have a few ideas how to improve this situation. I just opened apollographql/apollo-kotlin#4283 to start a list of things to do. Please follow the issue for updates.

In the meantime, I'd recommend you stick with version 2.x we will continue supporting it for bugfixes and Java codegen until Apollo 3 has a better Java story.

@aoudiamoncef @martinbonnin Thank you so much for this plugin.

I'll stay in2.x for now

All the credit goes to @aoudiamoncef for keeping up with our breaking changes 💪 !

Hi @mikkezavala,

I'll maintain Apollo 2 support, I released a newer version.

@aoudiamoncef thanks man! you rock

Does this being closed mean there is a way to generate getters?