There is an unknown One (1) data that is being stored without any other predicate than just uid
whenever I am creating answer
and comment
.
// Post Table
type Post struct {
UID string `json:"uid,omitempty"`
...
OwnerUserID Users `json:"OwnerUserID,omitempty"`
...
}
Whenever, I am creating question, It works fine.
Whenever, I am adding answers
or comment
, there is 2 node that is being stored. Here is one example of “answer” insert -
2 UID that are generated is:-
- UID `0x4e32
- UID
0x4e33
When.I query 0x4e32
like below-
{
result(func: uid(0x4e32)) {
uid
expand(_all_) {
uid
expand(_all_)
}
}
}
I get this, Which is completely OK, but
{
"data": {
"result": [
{
"uid": "0x4e32",
"ParentID": [
{
"uid": "0x4e29",
"Tags": " provlem life question answer",
"Title": "What is the main purpose?",
"CreatedAt": "2018-05-20T13:57:09.019039+05:45",
"PostType": "question"
}
],
"OwnerUserID": [
{
"uid": "0x1",
"Name": "Alice",
"CreatedAt": "2018-05-19T21:47:53.569504+05:45"
}
],
"CreatedAt": "2018-05-20T14:07:22.063477+05:45",
"PostType": "answer",
"Body": "The main purpose of test is to help the people with their provlem Four."
}
]
},
"extensions": {
"server_latency": {
"parsing_ns": 27000,
"processing_ns": 1325000,
"encoding_ns": 1267000
},
"txn": {
"start_ts": 30119,
"lin_read": {
"ids": {
"1": 79
}
}
}
}
}
But, When I query 0x4e33
, I get this -
{
"data": {
"result": [
{
"uid": "0x4e33",
"~OwnerUserID": [
{
"uid": "0x4e29",
"CreatedAt": "2018-05-20T13:57:09.019039+05:45",
"Title": "What is the main purpose?"
}
]
}
]
},
"extensions": {
"server_latency": {
"parsing_ns": 33000,
"processing_ns": 1262000,
"encoding_ns": 1728000
},
"txn": {
"start_ts": 30121,
"lin_read": {
"ids": {
"1": 79
}
}
}
}
}
I have no IDEA, why the second ghost UID is created, and every time, it has only 1 predicate as in reverse edge relation to OwnerUserID
And that too, OwnerUserID
is expected to User struct UID
and not of Post struct.But here, the OwnerUserID
is actually the UID
of Post struct - How is it possible?
Can I get help on this?