Graphql-code-generator: Remove implicit adding of `Input` suffix

Created on 10 May 2020  路  5Comments  路  Source: dotansimha/graphql-code-generator

https://github.com/dotansimha/graphql-code-generator/blob/f7d17324e7b24efbf46815139964ae042dd34657/packages/plugins/java/kotlin/src/visitor.ts#L125

Hi, I am developing a Java / Kotlin solution. And my problem is that I can't use Input endings in my schema for the input types because codegen utility translates input type names into SomeNameInputInput.
So, generally speaking, it duplicates the Input ending.

Can you make this optional? Or add some logic that checks "if type ends with Input word, then do not add additional Input word"?

Steps to reproduce:
1) Open https://graphql-code-generator.com/
2) Select Java --> Types (Enum & Input) in dropdown
3) Put this in the textarea on the left side

input CreateUserInput {
   userName: CreateUserNameInput
}

input CreateUserNameInput {
  given: String!
  family: String!
}

4) Find CreateUserNameInputInput in the right side textarea

bug plugins waiting-for-release

All 5 comments

Implemented a fix. See MR above.

Any update on this?

@dotansimha , @ardatan ?

Thanks @meiblorn . Your PR was merged. We'll release a new stable version soon. In the meantime, you can use the latest alpha version.

Available in v1.14.0.

Was this page helpful?
0 / 5 - 0 ratings