Hi Samadadi,
It seems to me that everything is normal, see the tests below. Something you are doing is wrong, please give more details of what you are doing.
Mutation
{
set {
_:Test <product.price> "0" .
_:Test2 <product.price> "0" .
_:Test3 <product.price> "2" .
_:Test4 <product.price> "4" .
_:Test5 <product.price> "88" .
_:Test6 <product.price> "9" .
_:Test7 <product.price> "0" .
_:Test8 <product.price> "0" .
_:Test9 <product.price> "200" .
_:Test10 <product.price> "4" .
_:Test11 <product.price> "8" .
_:Test12 <product.price> "9" .
_:Test13 <product.price> "0" .
_:Test14 <product.price> "0" .
_:Test15 <product.price> "25" .
_:Test16 <product.price> "4" .
_:Test17 <product.price> "8" .
_:Test18 <product.price> "90" .
_:Test19 <product.price> "90" .
}
}
Query 1
{
prices (func: has(product.price), orderdesc:product.price ){
uid
product.price
}
}
Result
{
"data": {
"prices": [
{
"uid": "0xd",
"product.price": 200
},
{
"uid": "0x1",
"product.price": 90
},
{
"uid": "0x10",
"product.price": 90
},
{
"uid": "0x2",
"product.price": 88
},
{
"uid": "0xa",
"product.price": 25
},
{
"uid": "0x3",
"product.price": 9
},
{
"uid": "0x9",
"product.price": 9
},
{
"uid": "0x6",
"product.price": 8
},
{
"uid": "0xf",
"product.price": 8
},
{
"uid": "0xe",
"product.price": 4
},
{
"uid": "0x11",
"product.price": 4
},
{
"uid": "0x13",
"product.price": 4
},
{
"uid": "0x7",
"product.price": 2
},
{
"uid": "0x4",
"product.price": 0
},
{
"uid": "0x5",
"product.price": 0
},
{
"uid": "0x8",
"product.price": 0
},
{
"uid": "0xb",
"product.price": 0
},
{
"uid": "0xc",
"product.price": 0
},
{
"uid": "0x12",
"product.price": 0
}
]
}
Query 1
{
prices (func: has(product.price), orderasc:product.price ){
uid
product.price
}
}
Result
{
"data": {
"prices": [
{
"uid": "0x4",
"product.price": 0
},
{
"uid": "0x5",
"product.price": 0
},
{
"uid": "0x8",
"product.price": 0
},
{
"uid": "0xb",
"product.price": 0
},
{
"uid": "0xc",
"product.price": 0
},
{
"uid": "0x12",
"product.price": 0
},
{
"uid": "0x7",
"product.price": 2
},
{
"uid": "0xe",
"product.price": 4
},
{
"uid": "0x11",
"product.price": 4
},
{
"uid": "0x13",
"product.price": 4
},
{
"uid": "0x6",
"product.price": 8
},
{
"uid": "0xf",
"product.price": 8
},
{
"uid": "0x3",
"product.price": 9
},
{
"uid": "0x9",
"product.price": 9
},
{
"uid": "0xa",
"product.price": 25
},
{
"uid": "0x2",
"product.price": 88
},
{
"uid": "0x1",
"product.price": 90
},
{
"uid": "0x10",
"product.price": 90
},
{
"uid": "0xd",
"product.price": 200
}
]
}