New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use custom scalars upgrade from 1.18.9 to 1.18.10 (Or 2.0RC1) #184
Comments
Hello, I'm surprised and annoyed that, with all the integration tests I have, this bug is possible. I could repeat this issue with the pom you provided. And yes, the dependencies for each custom scalar is mandatory. A workaround is to add the dependency to the plugin, like this: <plugin>
<groupId>com.graphql-java-generator</groupId>
<artifactId>graphql-maven-plugin</artifactId>
<version>1.18.10</version>
<executions>
<execution>
<goals>
<goal>generateClientCode</goal>
</goals>
</execution>
</executions>
<configuration>
<packageName>fr.cs.maps.mission.mus.database</packageName>
<customScalars>
<customScalar>
<graphQLTypeName>timestamp</graphQLTypeName>
<javaType>java.time.LocalDateTime</javaType>
<graphQLScalarTypeStaticField>
fr.cs.maps.database.customscalars.MAPSGraphQLScalarType.LocalDateTime
</graphQLScalarTypeStaticField>
</customScalar>
<customScalar>
<graphQLTypeName>geometry</graphQLTypeName>
<javaType>org.locationtech.jts.geom.Geometry</javaType>
<graphQLScalarTypeStaticField>
fr.cs.maps.database.customscalars.MAPSGraphQLScalarType.Geometry
</graphQLScalarTypeStaticField>
</customScalar>
<customScalar>
<graphQLTypeName>geography</graphQLTypeName>
<javaType>org.locationtech.jts.geom.Geometry</javaType>
<graphQLScalarTypeStaticField>
fr.cs.maps.database.customscalars.MAPSGraphQLScalarType.Geography
</graphQLScalarTypeStaticField>
</customScalar>
<customScalar>
<graphQLTypeName>float8</graphQLTypeName>
<javaType>java.lang.Double</javaType>
<graphQLScalarTypeStaticField>graphql.Scalars.GraphQLFloat</graphQLScalarTypeStaticField>
</customScalar>
<customScalar>
<graphQLTypeName>bytea</graphQLTypeName>
<javaType>java.lang.String</javaType>
<graphQLScalarTypeStaticField>graphql.Scalars.GraphQLString</graphQLScalarTypeStaticField>
</customScalar>
</customScalars>
<!-- The parameters below change the 1.x default behavior to respect the future 2.x behavior -->
<copyRuntimeSources>false</copyRuntimeSources>
<generateDeprecatedRequestResponse>false</generateDeprecatedRequestResponse>
<separateUtilityClasses>true</separateUtilityClasses>
<skipGenerationIfSchemaHasNotChanged>false</skipGenerationIfSchemaHasNotChanged>
</configuration>
<dependencies>
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>
<version>1.15.1</version>
</dependency>
</dependencies>
</plugin> I didn't check all the scalars you've defined, so perhaps other dependencies must be added for your all project to work. It will be solved in a next version. |
Adding the dependency worked. Thxs. |
Hello, The correction for this issue has been released the 2.3 version. |
While attempting to upgrade from 1.18.9 to 1.18.10 the generation now fails on custom scalars.
The code that causes errors is
The method exists with message Could not find the package for the class 'org.locationtech.jts.geom.Geometry', due to: org.locationtech.jts.geom.Geometry.
The pom.xml configuration is :
How to allow the generation with this new code, using types from external libraries?
The text was updated successfully, but these errors were encountered: