diff --git a/README.md b/README.md index e3ebe8f4709d16506ad11c84fb3a5eba3740ae2c..64ec977e9bfafd41206c5c2655b2be03d90d321b 100644 --- a/README.md +++ b/README.md @@ -13,23 +13,39 @@ Please refer to: ## Supported Options -| Key | Data Type | Default value | Description | -| ------------------------- | ------------------ | ------------------------------------- | ----------- | -| graphqlSchemaPaths | List(String) | None | GraphQL schema locations. You can supply multiple paths to GraphQL schemas. | -| packageName | String | Empty | Java package for generated classes. | -| outputDir | String | None | The output target directory into which code will be generated. | -| apiPackage | String | Empty | Java package for generated api classes (Query, Mutation, Subscription). | -| modelPackage | String | Empty | Java package for generated model classes (type, input, interface, enum, union). | -| generateApis | Boolean | True | Specifies whether api classes should be generated as well as model classes. | -| customTypesMapping | Map(String,String) | Empty | Can be used to supply custom mappings for scalars.
Supports:
* Map of (GraphqlObjectName.fieldName) to (JavaType)
* Map of (GraphqlType) to (JavaType) | -| customAnnotationsMapping | Map(String,String) | Empty | Can be used to supply custom annotations (serializers) for scalars.
Supports:
* Map of (GraphqlObjectName.fieldName) to (JavaType)
* Map of (GraphqlType) to (JavaType) | +| Key | Data Type | Default value | Description | +| ------------------------- | ------------------ | ----------------------------------------- | ----------- | +| graphqlSchemaPaths | List(String) | None | GraphQL schema locations. You can supply multiple paths to GraphQL schemas. | +| packageName | String | Empty | Java package for generated classes. | +| outputDir | String | None | The output target directory into which code will be generated. | +| apiPackage | String | Empty | Java package for generated api classes (Query, Mutation, Subscription). | +| modelPackage | String | Empty | Java package for generated model classes (type, input, interface, enum, union). | +| generateApis | Boolean | True | Specifies whether api classes should be generated as well as model classes. | +| customTypesMapping | Map(String,String) | Empty | Can be used to supply custom mappings for scalars.
Supports:
* Map of (GraphqlObjectName.fieldName) to (JavaType)
* Map of (GraphqlType) to (JavaType) | +| customAnnotationsMapping | Map(String,String) | Empty | Can be used to supply custom annotations (serializers) for scalars.
Supports:
* Map of (GraphqlObjectName.fieldName) to (JavaType)
* Map of (GraphqlType) to (JavaType) | | modelValidationAnnotation | String | @javax.validation.
constraints.NotNull | Annotation for mandatory (NonNull) fields. Can be null/empty. | -| modelNamePrefix | String | Empty | Sets the prefix for GraphQL model classes (type, input, interface, enum, union). | -| modelNameSuffix | String | Empty | Sets the suffix for GraphQL model classes (type, input, interface, enum, union). | -| subscriptionReturnType | String | Empty | Return type for subscription methods. For example: `org.reactivestreams.Publisher`, `io.reactivex.Observable`, etc. | -| generateEqualsAndHashCode | Boolean | False | Specifies whether generated model classes should have equals and hashCode methods defined. | -| generateToString | Boolean | False | Specifies whether generated model classes should have toString method defined. | - -### Inspired by +| modelNamePrefix | String | Empty | Sets the prefix for GraphQL model classes (type, input, interface, enum, union). | +| modelNameSuffix | String | Empty | Sets the suffix for GraphQL model classes (type, input, interface, enum, union). | +| subscriptionReturnType | String | Empty | Return type for subscription methods. For example: `org.reactivestreams.Publisher`, `io.reactivex.Observable`, etc. | +| generateEqualsAndHashCode | Boolean | False | Specifies whether generated model classes should have equals and hashCode methods defined. | +| generateToString | Boolean | False | Specifies whether generated model classes should have toString method defined. | +| jsonConfigurationFile | String | Empty | Path to an external mapping configuration. | + +### External mapping configuration + +Provide a path to external file via property `jsonConfigurationFile` +Sample content of the file: + +```json +{ + "generateApis": true, + "packageName": "com.kobylynskyi.graphql.testconfigjson", + "customTypesMapping": { + "Price.amount": "java.math.BigDecimal" + } +} +``` + +## Inspired by [swagger-codegen](https://github.com/swagger-api/swagger-codegen)