You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(#389): allow templating for generated Java / Kotlin class names
Adds an optional `nameTemplate` input parameter to the plugin, allowing
customization of the generated Java / Kotlin class names.
The following template variables are supported:
- name - the original name of the class
- schemaType - the GraphQL schema type (Type, Input, Interface, Enum)
The default value for this new property is null. In this case the output
will be identical to the current one.
Examples:
Given an original class name `Person` and schema type `Type`:
- null -> Person
- "{name}GraphQL{schemaType}" -> PersonGraphQLType
- "{name}GraphQL" -> PersonGraphQL
- "{name}{schemaType}" -> PersonType
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/java/DataTypeGenerator.kt
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/java/EnumTypeGenerator.kt
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/java/InterfaceGenerator.kt
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/java/UnionTypeGenerator.kt
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin/KotlinDataTypeGenerator.kt
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin/KotlinEnumTypeGenerator.kt
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin/KotlinInterfaceTypeGenerator.kt
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin/KotlinPoetUtils.kt
+4-4
Original file line number
Diff line number
Diff line change
@@ -97,15 +97,15 @@ fun disableJsonTypeInfoAnnotation(): AnnotationSpec {
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin/KotlinUnionTypeGenerator.kt
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin2/GenerateKotlin2DataTypes.kt
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin2/GenerateKotlin2EnumTypes.kt
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin2/GenerateKotlin2InputTypes.kt
Copy file name to clipboardExpand all lines: graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin2/GenerateKotlin2Interfaces.kt
0 commit comments