Skip to content

Conversation

@jxnu-liguobin
Copy link
Collaborator

@jxnu-liguobin jxnu-liguobin commented Nov 19, 2020

  1. Use the scala collection Seq whenever possible
  2. Use Scala's basic types as much as possible, and use Java's object type only when data can be null
  3. Immutable data structure is used by default
  4. Keep builder mode
  5. Unlike Java, enum must be imported into themselves
  6. All types use the case class
  7. Use Scala Option instead of Java Optional
  8. Also add in maven and gradle plugins
  9. Use @BeanProperty to override java get/set methods
  10. The default indentation uses four spaces, which is different from most Scala standard code, and may be changed later or introduce automatic formatting to avoid precise template configuration

and ...

In addition to the unit test, this code has been verified by all schema I have used, and generated 1000 Scala files.
The next step will provide the sample code used in the SBT plugin.

but only a draft

kobylynskyi
kobylynskyi previously approved these changes Nov 27, 2020
Copy link
Owner

@kobylynskyi kobylynskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jxnu-liguobin, that's great!
You did an awesome job.

@kobylynskyi kobylynskyi self-assigned this Nov 27, 2020
# Conflicts:
#	plugins/gradle/graphql-java-codegen-gradle-plugin/src/main/java/io/github/kobylynskyi/graphql/codegen/gradle/GraphQLCodegenGradleTask.java
#	plugins/maven/graphql-java-codegen-maven-plugin/src/main/java/io/github/kobylynskyi/graphql/codegen/GraphQLCodegenMojo.java
#	src/main/java/com/kobylynskyi/graphql/codegen/mapper/FieldDefinitionsToResolverDataModelMapper.java
#	src/main/java/com/kobylynskyi/graphql/codegen/model/GraphQLCodegenConfiguration.java
#	src/main/java/com/kobylynskyi/graphql/codegen/model/MappingConfig.java
#	src/main/java/com/kobylynskyi/graphql/codegen/model/MappingContext.java
@kobylynskyi
Copy link
Owner

kobylynskyi commented Nov 27, 2020

@jxnu-liguobin, just FYI: I've introduced some new changes recently which caused conflicts with your changes. So I resolved it.
Will release the library with your changes in 4.0.0 today 🚀

@kobylynskyi kobylynskyi merged commit 4bda965 into kobylynskyi:master Nov 27, 2020
@jxnu-liguobin jxnu-liguobin deleted the scala branch December 25, 2020 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants