-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
The Data Connect Kotlin codegen does some automatic, non-standard renaming of some selection set fields to "key" and "count".
For example, consider these two mutations:
mutation InsertItem($string: String, $int: Int) {
items_insert(data: {string: $string, int: $int})
}
mutation UpdateItemsWithString($string: String, $int: Int) {
items_updateMany(where: {string: {eq: $string}}, data: {int: $int})
}This generates the following Kotlin code:
@SerialName("items_insert") val key: ItemsKey
...
@SerialName("items_updateMany") val count: IntNote how the items_insert field is renamed to key and the items_updateMany field is renamed to count. These are unexpected and undocumented renames.
I instead expect it to generate the names from the graphql source without "magic" renaming, like this:
val items_insert: ItemsKey
...
val items_updateMany: IntIf I want those renames then I can do it myself by specifying key and count aliases, like this:
mutation InsertItem($string: String, $int: Int) {
key: items_insert(data: {string: $string, int: $int})
}
mutation UpdateItemsWithString($string: String, $int: Int) {
count: items_updateMany(where: {string: {eq: $string}}, data: {int: $int})
}