https://kotlinlang.org logo
#apollo-kotlin
Title
# apollo-kotlin
j

John O'Reilly

02/04/2023, 3:34 PM
Sorry if this has been asked already but is there way to rename/alias a property in query/result?
s

Spencer

02/04/2023, 4:05 PM
Yup! You should be able to do
newName: schemaName
on any property. https://www.apollographql.com/docs/kotlin/advanced/using-aliases#using-aliases-to-avoid-name-clashes
`emergencyContact { # With an alias, the generated model will be named
EmergencyAddress
emergencyAddress: homeAddress { street } }`
j

John O'Reilly

02/04/2023, 4:08 PM
perfect, thanks
6 Views