Hi is there a way to disable adding “Input” suffix...
# graphql-kotlin
d
Hi is there a way to disable adding “Input” suffix for Graphql input types?
d
hi 👋 there is no option to disable it globally but you can overwrite individual entries using
@GraphQLName
see https://expediagroup.github.io/graphql-kotlin/docs/schema-generator/customizing-schemas/renaming-fields
d
Thanks, I tried it, it still added the Input at the end.
note: renaming input object will most likely require custom data fetcher logic to correctly serialize the renamed input type to corresponding graphql type (or I guess jackson annotation might work as well)
d
Thanks Dariusz, The test you linked is actually showing that the Input suffix is always added. The
@GraphQLName
annotation says the type name should be
InputClassRenamed
Copy code
@GraphQLName("InputClassRenamed")
    private class InputClassCustomName {
        @GraphQLName("myFieldRenamed")
        val myField: String = "car"
    }
But the test asserts that the name is
InputClassRenamedInput
:
Copy code
@Test
fun `Test custom naming on classes`() {
    val result = generateInputObject(generator, InputClassCustomName::class)
    assertEquals("InputClassRenamedInput", result.name)
}
Anyway it’s not a big deal I think we can live with
Input
suffix 🙂
d
My bad, indeed it seems we always append input