Hey,
I was wondering if its possible to render edges with single value as a list type instead of a object array.
The reason behind this is I’ve got images saved with an hash used for searching by image.
At the moment I’m modifying my JSON at the edge, this works fine but isn’t the cleanest solution.
My query:
{
product(func: uid(0x70980)) {
name : <http://schema.org/name>
description : <http://schema.org/description>
image {
url
}
}
}
Output:
{
"product": [
{
"name": "Bissell Multi-oppervlaktereiniger",
"description": "De veelzijdige CrossWave stofzuigt, dweilt en helpt bij het drogen van vloeren. \n- zowel natte als droge reiniging \n- geen stofzak",
"image": [
{
"url": "https://www.alternate.nl/p/450x450/n/ntzrza9k_30.jpg"
},
{
"url": "https://www.alternate.nl/p/450x450/1/1ss9a04z_30.jpg"
},
{
"url": "https://www.alternate.nl/p/450x450/9/9gsheq09_30.jpg"
}
]
}
]
}
Wanted output:
{
"product": [
{
"name": "Bissell Multi-oppervlaktereiniger",
"description": "De veelzijdige CrossWave stofzuigt, dweilt en helpt bij het drogen van vloeren. \n- zowel natte als droge reiniging \n- geen stofzak",
"image": [
"https://www.alternate.nl/p/450x450/n/ntzrza9k_30.jpg",
"https://www.alternate.nl/p/450x450/1/1ss9a04z_30.jpg",
"https://www.alternate.nl/p/450x450/9/9gsheq09_30.jpg"
]
}
]
}
Is there any functionality like this currently in Dgraph? If not, I gladly create a PR if there is interest.
Thanks!
Stefan Fransen