Issue Description
Describe your bug in detail.
For normal classes, Scala does not generate get methods for fields by default. So fields cannot be access in other methods.(This is a problem that is not in a hurry to solve)
There are two solutions:
- explicitly add
val / var to the constructor of ordinary class.
- or add
@BeanProperty on field.
If Java interoperability is required, the second method should be used, otherwise the first method should be used. I think the first method should be used here.
https://stackoverflow.com/questions/15639078/scala-class-constructor-parameters.
This problem is very clear and easy to solve. At the same time, Newcomes can understand some knowledge of scala compilation. I hope it can also be as a good first issue.
Your Environment and Setup
- graphql-java-codegen version: 4.1.5-SNAPSHOT
- Build tool: E.g.: Maven/Gradle/SBT
- Mapping Config: E.g.:
<configuration>
<outputDir>${project.build.directory}/generated-sources/graphql</outputDir>
<packageName>io.github.kobylynskyi.graphql.model</packageName>
</configuration>
Issue Description
Describe your bug in detail.
For normal classes, Scala does not generate
getmethods for fields by default. So fields cannot be access in other methods.(This is a problem that is not in a hurry to solve)There are two solutions:
val / varto the constructor of ordinary class.@BeanPropertyon field.If Java interoperability is required, the second method should be used, otherwise the first method should be used. I think the first method should be used here.
https://stackoverflow.com/questions/15639078/scala-class-constructor-parameters.
This problem is very clear and easy to solve. At the same time, Newcomes can understand some knowledge of scala compilation. I hope it can also be as a
good first issue.Your Environment and Setup