I am using below configuration
<plugin>
<groupId>io.github.kobylynskyi</groupId>
<artifactId>graphql-codegen-maven-plugin</artifactId>
<version>${graphqlcodegen-maven-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<graphqlSchemas>
<rootDir>${project.basedir}/src/main/resources/graphql/</rootDir>
</graphqlSchemas>
<generatedLanguage>KOTLIN</generatedLanguage>
<generateEqualsAndHashCode>true</generateEqualsAndHashCode>
<outputDir>${project.basedir}/target/generated</outputDir>
<addGeneratedAnnotation>false</addGeneratedAnnotation>
<generateClient>true</generateClient>
<packageName>com.intuit.identity.manage.model</packageName>
<modelPackageName>com.intuit.identity.manage.model.graphql</modelPackageName>
<apiPackageName>com.intuit.identity.manage.model.querybuilders</apiPackageName>
<initializeNullableTypes>true</initializeNullableTypes>
<customTypesMapping>
<Date>java.time.LocalDate</Date>
<DateTime>java.time.LocalDateTime</DateTime>
</customTypesMapping>
<useObjectMapperForRequestSerialization>
Date,DateTime
</useObjectMapperForRequestSerialization>
<customAnnotationsMapping>
<TrustedAccountInput.accountId>
<annotation>com.intuit.identity.manage.account.model.constraints.ValidAccountId</annotation>
</TrustedAccountInput.accountId>
</customAnnotationsMapping>
</configuration>
</plugin>
And the model classes generated is like so
data class TrustedAccountInput(
@get:com.intuit.identity.manage.account.model.constraints.ValidAccountId
var accountId: String,
var mirrorProfile: ProfileInput? = null,
var trustGrant: TrustGrantInput,
var primaryProfile: PrimaryProfileInput? = null,
var mirrorPrimaryProfile: Boolean? = null
) {/*some impl here*/}
Can you please let me know what config change has to be added to apply the custom annotation on field instead of getter.
I am using below configuration
And the model classes generated is like so
Can you please let me know what config change has to be added to apply the custom annotation on field instead of getter.