I want to paginate with facets but it doesn’t work properly. I have shared examples below.
@QUERY
{
data(func: eq(xid, "tperson1")) {
xid
~follows @facets(since: since){
xid
uid
}
}
}
@RESULT
{
"data": {
"data": [
{
"xid": "tperson1",
"~follows": [
{
"xid": "tperson3",
"uid": "0x1",
"since": "2022-03-21T11:34:34.209952Z"
},
{
"xid": "tperson2",
"uid": "0x3",
"since": "2022-03-21T11:34:50.421852Z"
},
{
"xid": "tperson5",
"uid": "0x5",
"since": "2022-03-21T11:56:22.856515Z"
}
]
}
]
}
}
Pagination is working without facets.
@QUERY
{
data(func: eq(xid, "tperson1")) {
xid
~follows{
xid
uid
}(offset:2, first:1)
}
}
@RESULT
{
"data": {
"data": [
{
"xid": "tperson1",
"~follows": [
{
"xid": "tperson5",
"uid": "0x5"
}
]
}
]
}
}
But pagination is not working correctly with facets.
@QUERY
{
data(func: eq(xid, "tperson1")) {
xid
~follows @facets(since: since){
xid
uid
}(offset:2, first:1)
}
}
@RESULT
{
"data": {
"data": [
{
"xid": "tperson1",
"~follows": [
{
"xid": "tperson5",
"uid": "0x1",
"since": "2022-03-21T11:34:34.209952Z"
},
{
"xid": "tperson5",
"uid": "0x3",
"since": "2022-03-21T11:34:50.421852Z"
},
{
"xid": "tperson5",
"uid": "0x5",
"since": "2022-03-21T11:56:22.856515Z"
}
]
}
]
}
}
Another case is when using after instead of offset, pagination works with facets
@QUERY
{
data(func: eq(xid, "tperson1")) {
xid
~follows @facets(since: since){
xid
uid
}(after:0x3, first:1)
}
}
@RESULT
{
"data": {
"data": [
{
"xid": "tperson1",
"~follows": [
{
"xid": "tperson5",
"uid": "0x5",
"since": "2022-03-21T11:56:22.856515Z"
}
]
}
]
}
}
Any reason why this is happening?
-Dgraph version: v21.12.0