FYI, There’s a better way to do this using Inline Fragments:
query RunInput {
cart {
lines {
id
quantity
attributes {
... on Attribute {
key
value
}
}
}
}
}
That will give you an array of all the attributes:
"attributes": [
{
"key": "test1",
"value": "true"
},
{
"key": "test2",
"value": "false"
}
]