The uid has not been created, but it appears in the query's result list

type User {
    name
    ...
}
name: string @index(hash) .

I tried to delete some data,

{
  "delete":{
    "uid": "0x4e99"
  }
}

But all other fields have been deleted, only the uid has not been deleted, it still exists.

{
  user(func: uid(0x4e99)) {
     uid
     name
  }
}

The result:

"data": {
    "user": [
       {
          "uid": "0x4e99"
       }
    ]
}

Later I found that any uid that conforms to int64 exists.

For example, I randomly query a non-existent uid, but it appears in the result list:

{
  user(func: uid(0xce93224642121459)) {
     uid
     name
  }
}

The result:

"data": {
    "user": [
       {
          "uid": "0xce93224642121459"
       }
    ]
}

I don’t understand why this is happening. I have many queries that depend on uid, but due to the above problems, my program frequently makes mistakes.

Please help me.

Yes, I can reproduce in my system as well. From what I understand, this is coming from package query.go, line#1973, where we assign src uids to dest uids without checking if they exist.

Thanks for reporting! I have created an issue for this.

1 Like

Oh. Hope to fix this problem as soon as possible, it has been bothering me.
Cheers.