Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 29 additions & 27 deletions docs/generating-code-from-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,30 +536,32 @@ public class Person {
Code generation has many configuration switches.
The following table shows the Gradle configuration options, but the same options are available command line and in Maven as well.

| Configuration property | Description | Default Value |
|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ----------- |
| schemaPaths | List of files/directories containing schemas | src/main/resources/schema |
| packageName | Base package name of generated code | |
| subPackageNameClient | Sub package name for generated Query API | client |
| subPackageNameDatafetchers | Sub package name for generated data fetchers | datafetchers |
| subPackageNameTypes | Sub package name for generated data types | types |
| language | Either `java` or `kotlin` | Autodetected from project |
| typeMapping | A Map where each key is a GraphQL type, and the value the FQN of a Java class | |
| generateBoxedTypes | Always use boxed types for primitives | false (boxed types are used only for nullable fields) |
| generateClient | Generate a Query API. This property does the same thing as generateClientv2. | false |
| generateClientv2 | Generate a Query API. This property does the same thing as generateClient. | false |
| generateDataTypes | Generate data types. Useful for only generating a Query API. Input types are still generated when `generateClientv2` is true. | true |
| generateInterfaces | Generate interfaces for data classes. This is useful if you would like to extend the generated POJOs for more context and use interfaces instead of the data classes in your data fetchers. | false |
| generatedSourcesDir | Build directory for Gradle | build |
| includeQueries | Generate Query API only for the given list of Query fields | All queries defined in schema |
| includeMutations | Generate Query API only for the given list of Mutation fields | All mutations defined in schema |
| includeSubscriptions | Generate Query API only for the given list of Subscription fields | All subscriptions defined in schema |
| skipEntityQueries | Disable generating Entity queries for federated types | false |
| shortProjectionNames | Shorten class names of projection types. These types are not visible to the developer. | false |
| maxProjectionDepth | Maximum projection depth to generate. Useful for (federated) schemas with very deep nesting | 10 |
| includeImports | Maps the custom annotation type to the package, the annotations belong to. Only used when generateCustomAnnotations is enabled. | |
| includeEnumImports | Maps the custom annotation and enum argument names to the enum packages. Only used when generateCustomAnnotations is enabled. | |
| includeClassImports | Maps the custom annotation and class names to the class packages. Only used when generateCustomAnnotations is enabled.
| generateCustomAnnotations | Enable/disable generation of custom annotation | false |
| addGeneratedAnnotation | Add `jakarta.annotation.Generated` and application specific `@Generated` annotation to generated types | false |
| disableDatesInGeneratedAnnotation | Don't add a date to the `jakarta.annotation.Generated` annotation | false |
| Configuration property | Description | Default Value |
|-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|
| schemaPaths | List of files/directories containing schemas | src/main/resources/schema |
| packageName | Base package name of generated code | |
| subPackageNameClient | Sub package name for generated Query API | client |
| subPackageNameDatafetchers | Sub package name for generated data fetchers | datafetchers |
| subPackageNameTypes | Sub package name for generated data types | types |
| language | Either `java` or `kotlin` | Autodetected from project |
| typeMapping | A Map where each key is a GraphQL type, and the value the FQN of a Java class | |
| generateBoxedTypes | Always use boxed types for primitives | false (boxed types are used only for nullable fields) |
| generateClient | Generate a Query API. This property does the same thing as generateClientv2. | false |
| generateClientv2 | Generate a Query API. This property does the same thing as generateClient. | false |
| generateDataTypes | Generate data types. Useful for only generating a Query API. Input types are still generated when `generateClientv2` is true. | true |
| generateInterfaces | Generate interfaces for data classes. This is useful if you would like to extend the generated POJOs for more context and use interfaces instead of the data classes in your data fetchers. | false |
| generatedSourcesDir | Build directory for Gradle | build |
| includeQueries | Generate Query API only for the given list of Query fields | All queries defined in schema |
| includeMutations | Generate Query API only for the given list of Mutation fields | All mutations defined in schema |
| includeSubscriptions | Generate Query API only for the given list of Subscription fields | All subscriptions defined in schema |
| skipEntityQueries | Disable generating Entity queries for federated types | false |
| shortProjectionNames | Shorten class names of projection types. These types are not visible to the developer. | false |
| maxProjectionDepth | Maximum projection depth to generate. Useful for (federated) schemas with very deep nesting | 10 |
| includeImports | Maps the custom annotation type to the package, the annotations belong to. Only used when generateCustomAnnotations is enabled. | |
| includeEnumImports | Maps the custom annotation and enum argument names to the enum packages. Only used when generateCustomAnnotations is enabled. | |
| includeClassImports | Maps the custom annotation and class names to the class packages. Only used when generateCustomAnnotations is enabled. | |
| generateCustomAnnotations | Enable/disable generation of custom annotation | false |
| addGeneratedAnnotation | Add `jakarta.annotation.Generated` and application specific `@Generated` annotation to generated types | false |
| disableDatesInGeneratedAnnotation | Don't add a date to the `jakarta.annotation.Generated` annotation | false |
| javaGenerateAllConstructor | Enable/disable generation of parameterized constructors | true |