-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding custom suffix to generated types #389
Comments
I can see that being hard to use. We can looking into improving that in the future. Feel free to open a PR if you would like to have that available sooner. |
@srinivasankavitha Thank you for your response. |
This reverts commit ce92bc3.
+1, I'm going to name my entities |
Ah ok, we don't maintain or own the maven plugin. That is more community
maintained.
…On Tue, Jun 7, 2022 at 12:59 PM maory ***@***.***> wrote:
@srinivasankavitha <https://github.com/srinivasankavitha> Thank you for
your response.
I will check out that, Since I am using maven I will need another PR for
the maven plugin to support such kind of config.
—
Reply to this email directly, view it on GitHub
<#389 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ5JPXLCKNBEH6FXTUTKFSLVN6SZZANCNFSM5YDGP4WA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I'm using gradle, just FYI |
… 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
… 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
… 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
… 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
… 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
… 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
… 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
… 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
… 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
With DGS codegen, I want the schema types to correspond my Model entity types.
For example let's assume that I have a query in my schema:
My generated type will be
<generated_types_package>.Dog.java
In most cases, I will have another class for my model object.
<model_type_package>.Dog.java
What happens in this case that in my DataFetcher I need to declare explicitly on the type package prefix, which makes the code pretty hard to read.
My suggestion is to add a custom suffix to any schema generated type (not input)
<model_type_package>.Dog.java
--><model_type_package>.DogGQL.java
The text was updated successfully, but these errors were encountered: