Skip to content

Instantly share code, notes, and snippets.

@romshark
Last active May 28, 2019 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romshark/6c33430d0dae4eaf2835670d4df969b4 to your computer and use it in GitHub Desktop.
Save romshark/6c33430d0dae4eaf2835670d4df969b4 to your computer and use it in GitHub Desktop.
Dgraph pagination (after uid cursor)
{
pageAfter(
func: has(Post.id),
orderdesc: Post.id,
first: 3,
after: 0x59722
) {
uid
Post.id
Post.title
}
}
[
{
"uid": "0x726ff",
"Post.id": "0002125203e24d209c479c2dc2c35cd9",
"Post.title": "Howlerbevel"
},
{
"uid": "0x65dbd",
"Post.id": "0000dcff5ccb46efb93c10fd690c19c3",
"Post.title": "Wizardglen"
},
{
"uid": "0x78324",
"Post.id": "00007ad049584dfaa38d0dcb14a69f37",
"Post.title": "Ridgemaple"
}
]
{
"extensions": {
"server_latency": {
"parsing_ns": 12400,
"processing_ns": 52115900,
"encoding_ns": 1094700
},
"txn": {
"start_ts": 951353
}
},
"data": {
"pageAfter": [
{
"uid": "0x5aefe",
"Post.id": "fffff17452eb4d509b68ebb15ad8079f",
"Post.title": "Eyeagate"
},
{
"uid": "0x73133",
"Post.id": "ffff0294e6db4a55878bf823e4ffb283",
"Post.title": "Songmagenta"
},
{
"uid": "0x74920",
"Post.id": "fffe881e472747488e5ba1055f693929",
"Post.title": "Hidequiver"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment