Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination param "after" does not work when using func: uid(v) #5242

Closed
dkjii-g opened this issue Apr 19, 2020 · 2 comments · Fixed by #6365
Closed

Pagination param "after" does not work when using func: uid(v) #5242

dkjii-g opened this issue Apr 19, 2020 · 2 comments · Fixed by #6365
Labels
area/querylang/function exp/intermediate Fixing this requires some experience with the project. kind/bug Something is broken. status/accepted We accept to investigate/work on it.

Comments

@dkjii-g
Copy link

dkjii-g commented Apr 19, 2020

What version of Dgraph are you using?

v1.2.0

Have you tried reproducing the issue with the latest release?

Yes

What is the hardware spec (RAM, OS)?

4G, Linux

Steps to reproduce the issue (command/config used to run Dgraph).

Go to
https://dgraph.io/docs/query-language/#inequality
Try:

curl -H "Content-Type: application/graphql+-" localhost:8080/query -XPOST -d '
{
  var(func: has(name@en), first: 50) {
    test as uid
  }

  ss(func: uid(test), first: 2, after: 0x6) {
    uid
  }
}' | python -m json.tool | less

Response:

{
  "data": {
    "ss": [
      {
        "uid": "0x4"
      },
      {
        "uid": "0x6"
      }
    ]
  }
}

Expected behaviour and actual result.

Expected:
Returns uid > 0x6

@MichelDiz
Copy link
Contributor

Yeah, confirmed. It is a bug.

Tested in

Dgraph version   : v20.03.0
Dgraph SHA-256   : e0710c6112cb63a03648e3e49f220b563bab0e35db1fcfc3bbfe8f060384e96a
Commit SHA-1     : 147c8df9
Commit timestamp : 2020-03-30 17:28:31 -0700
Branch           : HEAD
Go version       : go1.14.1

Maybe the fix should be backported to v1.2.0.

Query used in my side

{
  actual_result(func: uid(test), first: 2, after: 0x1efe25) {
    uid
    objectName
  }
  Expected(func: has(objectName), first: 2, after: 0x1efe25) {
    uid
    objectName
  }
  varg(func: has(objectName), first: 50) {
    test as uid
    objectName
  }
}

Result

{
  "data": {
    "actual_result": [
      {
        "uid": "0x1efe21",
        "objectName": "Object 1"
      },
      {
        "uid": "0x1efe22",
        "objectName": "Object 2"
      }
    ],
    "Expected": [
      {
        "uid": "0x1efe26",
        "objectName": "Object 6"
      },
      {
        "uid": "0x1efe27",
        "objectName": "Object 7"
      }
    ],
    "varg": [
      {
        "uid": "0x1efe21",
        "objectName": "Object 1"
      },
      {
        "uid": "0x1efe22",
        "objectName": "Object 2"
      },
      {
        "uid": "0x1efe23",
        "objectName": "Object 3"
      },
      {
        "uid": "0x1efe24",
        "objectName": "Object 4"
      },
      {
        "uid": "0x1efe25",
        "objectName": "Object 5"
      },
      {
        "uid": "0x1efe26",
        "objectName": "Object 6"
      },
      {
        "uid": "0x1efe27",
        "objectName": "Object 7"
      }
    ]
  }
}

Dataset

{
      "set": [
        {
          "objectName": "Object 1"
        },
        {
          "objectName": "Object 2"
        },
        {
          "objectName": "Object 3"
        },
        {
          "objectName": "Object 4"
        },
        {
          "objectName": "Object 5"
        },
        {
          "objectName": "Object 6"
        },
        {
          "objectName": "Object 7"
        }
      ]
    }

@MichelDiz MichelDiz added area/querylang/function exp/intermediate Fixing this requires some experience with the project. kind/bug Something is broken. status/accepted We accept to investigate/work on it. labels Apr 20, 2020
@MichelDiz MichelDiz changed the title after: does not work when using func: uid(v) Pagination param "after" does not work when using func: uid(v) Apr 20, 2020
@minhaj-shakeel
Copy link
Contributor

Github issues have been deprecated.
This issue has been moved to discuss. You can follow the conversation there and also subscribe to updates by changing your notification preferences.

drawing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment