Skip to content

Commit 994d494

Browse files
committed
Updates from graphql-java-codegen:1.2. Prepare for 1.2 release
1 parent c0ba341 commit 994d494

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ Using [legacy plugin application](https://docs.gradle.org/current/userguide/plug
4949
DateTime: "org.joda.time.DateTime"
5050
Price.amount: "java.math.BigDecimal"
5151
]
52+
customAnnotationsMapping = [
53+
DateTime: "com.fasterxml.jackson.databind.annotation.JsonDeserialize(using = com.example.json.EpochMillisScalarDeserializer.class"
54+
]
5255
modelNameSuffix = "TO"
5356
}
5457

@@ -65,6 +68,7 @@ Using [legacy plugin application](https://docs.gradle.org/current/userguide/plug
6568
outputDir = File("$buildDir/generated/graphql")
6669
packageName = "com.example.graphql.model"
6770
customTypesMapping = mutableMapOf(Pair("EpochMillis", "java.time.LocalDateTime"))
71+
customAnnotationsMapping = mutableMapOf(Pair("EpochMillis", "com.fasterxml.jackson.databind.annotation.JsonDeserialize(using = com.example.json.EpochMillisScalarDeserializer.class"))
6872
}
6973

7074
// Automatically generate GraphQL code on project build:
@@ -80,16 +84,19 @@ Using [legacy plugin application](https://docs.gradle.org/current/userguide/plug
8084

8185
#### Plugin Options
8286

83-
| Key | Data Type | Default value | Description |
84-
| ----------------------- | ------------------ | ------------- | ----------- |
85-
| graphqlSchemaPaths | List(String) | None | GraphQL schema locations. You can supply multiple paths to GraphQL schemas. |
86-
| packageName | String | Empty | Java package for generated classes. |
87-
| outputDir | String | None | The output target directory into which code will be generated. |
88-
| customTypesMapping | Map(String,String) | Empty | Can be used to supply custom mappings for scalars. <br/> Supports:<br/> * Map of (GraphqlObjectName.fieldName) to (JavaType) <br/> * Map of (GraphqlType) to (JavaType) |
89-
| modelNamePrefix | String | Empty | Sets the prefix for GraphQL model classes (type, input, interface, enum, union). |
90-
| modelNameSuffix | String | Empty | Sets the suffix for GraphQL model classes (type, input, interface, enum, union). |
91-
| apiPackage | String | Empty | Java package for generated api classes (Query, Mutation, Subscription). |
92-
| modelPackage | String | Empty | Java package for generated model classes (type, input, interface, enum, union). |
87+
| Key | Data Type | Default value | Description |
88+
| ------------------------- | ------------------ | ------------------------------------- | ----------- |
89+
| graphqlSchemaPaths | List(String) | None | GraphQL schema locations. You can supply multiple paths to GraphQL schemas. |
90+
| packageName | String | Empty | Java package for generated classes. |
91+
| outputDir | String | None | The output target directory into which code will be generated. |
92+
| apiPackage | String | Empty | Java package for generated api classes (Query, Mutation, Subscription). |
93+
| modelPackage | String | Empty | Java package for generated model classes (type, input, interface, enum, union). |
94+
| generateApis | Boolean | True | Java package for generated model classes (type, input, interface, enum, union). |
95+
| customTypesMapping | Map(String,String) | Empty | Can be used to supply custom mappings for scalars. <br/> Supports:<br/> * Map of (GraphqlObjectName.fieldName) to (JavaType) <br/> * Map of (GraphqlType) to (JavaType) |
96+
| customAnnotationsMapping | Map(String,String) | Empty | Can be used to supply custom annotations (serializers) for scalars. <br/> Supports:<br/> * Map of (GraphqlObjectName.fieldName) to (JavaType) <br/> * Map of (GraphqlType) to (JavaType) |
97+
| modelValidationAnnotation | String | @javax.validation.<br>constraints.NotNull | Annotation for mandatory (NonNull) fields. Can be null/empty. |
98+
| modelNamePrefix | String | Empty | Sets the prefix for GraphQL model classes (type, input, interface, enum, union). |
99+
| modelNameSuffix | String | Empty | Sets the suffix for GraphQL model classes (type, input, interface, enum, union). |
93100

94101

95102
### Example

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ pluginManagement {
66
}
77

88
include 'graphql-codegen-gradle-plugin'
9-
//include 'graphql-codegen-gradle-plugin-example'
9+
include 'graphql-codegen-gradle-plugin-example'

0 commit comments

Comments
 (0)