Marco Pierucci
11/12/2025, 7:13 PMMarco Pierucci
11/12/2025, 7:13 PMquery ServerDrivenPageQuery($appointmentId: UUID!, $pageId: String!) {
page(appointmentId: $appointmentId, pageId: $pageId) {
...ServerDrivenPageFragment
}
}
fragment ServerDrivenPageFragment on Page {
id
sections {
id
components {
__typename
...ItemRowFragment
...TimelineCardFragment
...ListCardFragment
}
}
}
fragment ItemRowFragment on ItemRow {
rowLabel: label
value
}
fragment TimelineCardFragment on TimelineCard {
header
cardLabel: label
action {
value
}
rows {
...ItemRowFragment
}
}
fragment ListCardFragment on ListCard {
header
rows {
...ItemRowFragment
}
}
Here Ive defined cardLabel and rowLabel aliases for the label value in both typeMarco Pierucci
11/12/2025, 7:14 PMval sut = ServerDrivenPageFragmentImpl.Data(FakeKrakenFieldResolver()) {
id = "page_1"
sections = listOf(
buildUiSection {
id = "section_1"
components = emptyList()
},
buildUiSection {
id = "section_2"
components = listOf(
buildItemRow {
label = "Label 1"
value = "Value 1"
},
buildListCard {
header = "List Card Header"
rows = listOf(
buildItemRow {
label = "List Item 2"
value = "List Value 2"
},
buildItemRow {
label = "List Item 3"
value = "List Value 3"
},
)
},
buildTimelineCard {
header = "Timeline Card Header"
label = "Card Label"
action = buildHyperlink {
value = "<https://example.com/action>"
}
rows = listOf(
buildItemRow {
label = "Timeline Item 4"
value = "Timeline Value 4"
},
)
},
buildOtherUiComponent("__forcedNull") {
},
)
},
)
}Marco Pierucci
11/12/2025, 7:15 PMMarco Pierucci
11/12/2025, 7:16 PMpublic class ItemRowBuilder(
customScalarAdapters: CustomScalarAdapters,
) : ObjectBuilder<ItemRowMap>(customScalarAdapters) {
public var label: String by __fields
public var `value`: String by __fields
init {
__typename = "ItemRow"}
override fun build(): ItemRowMap = ItemRowMap(__fields)
}
I can see the generated builder expose label rather than rowLabel but that should not be an issue should be? What am i misisng for my value to be picked up?mbonnin
11/12/2025, 7:30 PMmbonnin
11/12/2025, 7:31 PMMarco Pierucci
11/12/2025, 7:37 PMmbonnin
11/12/2025, 7:38 PMmbonnin
11/12/2025, 7:41 PMbuildItemRow {
label = "Label 1"
value = "Value 1"
},
If you're using aliases, I would expect something more like so:
buildItemRow {
this["rowLabel"] = "Label 1"
value = "Value 1"
},
https://www.apollographql.com/docs/kotlin/testing/data-builders#aliasesMarco Pierucci
11/12/2025, 7:45 PMMarco Pierucci
11/12/2025, 7:45 PMmbonnin
11/12/2025, 7:45 PMmbonnin
11/12/2025, 7:45 PMMarco Pierucci
11/12/2025, 7:46 PMmbonnin
11/12/2025, 7:47 PMMarco Pierucci
11/12/2025, 7:50 PM