GeneratedName

data class GeneratedName(val kotlinName: String, val wireName: String)(source)

Holds both the Kotlin identifier and its corresponding wire-format name after allocation through GraphNameAllocator.

Two-Name Model

Each generated name carries two representations:

  1. kotlinName — The collision-safe, keyword-escaped Kotlin identifier used in generated source code (e.g. privateValue, isActive, OPEN). This is what appears as the property name, class name, or enum constant in generated .kt files.

  2. wireName — The original GraphQL name, never transformed. Always set before keyword escaping or collision resolution. Never derived from kotlinName. This is what gets written to @SerialName("wireName") or @SerializedName("wireName"), ensuring correct JSON field mapping regardless of Kotlin renaming.

Invariant

// wireName is always the original -- never derived from kotlinName
val name = allocator.allocatePropertyName("private")
name.wireName == "private" // always true
name.kotlinName == "privateValue" // keyword-escaped for Kotlin

Since

1.0

See also

Constructors

Link copied to clipboard
constructor(kotlinName: String, wireName: String)

Properties

Link copied to clipboard

The collision-safe Kotlin identifier suitable for use in generated code (e.g. privateValue, isActive, OPEN).

Link copied to clipboard

The original GraphQL name preserved for use in serialization annotations (@SerialName, @SerializedName).