@spinelsun, It looks like you found a bug:
If you do this mutation:
On this schema:
And then run this query:
It should have produced the results:
Or <-> Michal
Michal <-> Justin
Or <-> Elior
But if you look at the results we will find:
Or -> Michal
Michal <-> Justin
Or <-> Elior
@MichelDiz, @Pawan I think we have a bug here where the person “Or” is only linked to Michal with a one-way link instead of a two way as it should have been done.
Just tested on Slash: v20.07.1-rc1-12-gbfa6277f
And here is the complete steps to reproduce:
addPerson(
input: [
{
name: "Or"
friends: [
{ name: "Michal", friends: [{ name: "Justin" }] }
{ name: "Elior" }
]
}
]
) {
person {
name
friends {
name
}
}
}
}
query ReadData {
queryPerson{
id
name
friends{
name
friends{
name
}
}
}
}
mutation ResetData {
deletePerson (filter: {}) { numUids }
}
AddData:
{
"data": {
"addPerson": {
"person": [
{
"name": "Or",
"friends": [
{
"name": "Michal"
},
{
"name": "Elior"
}
]
}
]
}
},
"extensions": {
"touched_uids": 8,
"tracing": {
"version": 1,
"startTime": "2020-09-07T14:47:21.526305936Z",
"endTime": "2020-09-07T14:47:21.538247035Z",
"duration": 11941104,
"execution": {
"resolvers": [
{
"path": [
"addPerson"
],
"parentType": "Mutation",
"fieldName": "addPerson",
"returnType": "AddPersonPayload",
"startOffset": 128337,
"duration": 11795506,
"dgraph": [
{
"label": "mutation",
"startOffset": 208815,
"duration": 4902737
},
{
"label": "query",
"startOffset": 7524027,
"duration": 4364265
}
]
}
]
}
},
"queryCost": 1
}
}
ReadData:
{
"data": {
"queryPerson": [
{
"id": "0x7",
"name": "Justin",
"friends": [
{
"name": "Michal",
"friends": [
{
"name": "Justin"
}
]
}
]
},
{
"id": "0x8",
"name": "Michal",
"friends": [
{
"name": "Justin",
"friends": [
{
"name": "Michal"
}
]
}
]
},
{
"id": "0x9",
"name": "Or",
"friends": [
{
"name": "Michal",
"friends": [
{
"name": "Justin"
}
]
},
{
"name": "Elior",
"friends": [
{
"name": "Or"
}
]
}
]
},
{
"id": "0xa",
"name": "Elior",
"friends": [
{
"name": "Or",
"friends": [
{
"name": "Michal"
},
{
"name": "Elior"
}
]
}
]
}
]
},
"extensions": {
"touched_uids": 32,
"tracing": {
"version": 1,
"startTime": "2020-09-07T14:48:46.961435556Z",
"endTime": "2020-09-07T14:48:46.96342668Z",
"duration": 1991133,
"execution": {
"resolvers": [
{
"path": [
"queryPerson"
],
"parentType": "Query",
"fieldName": "queryPerson",
"returnType": "[Person]",
"startOffset": 146977,
"duration": 1800338,
"dgraph": [
{
"label": "query",
"startOffset": 195516,
"duration": 1678721
}
]
}
]
}
},
"queryCost": 1
}
}
ResetData:
{
"data": {
"deletePerson": {
"numUids": 4
}
},
"extensions": {
"touched_uids": 8,
"tracing": {
"version": 1,
"startTime": "2020-09-07T14:49:59.435734133Z",
"endTime": "2020-09-07T14:49:59.444221073Z",
"duration": 8486954,
"execution": {
"resolvers": [
{
"path": [
"deletePerson"
],
"parentType": "Mutation",
"fieldName": "deletePerson",
"returnType": "DeletePersonPayload",
"startOffset": 135600,
"duration": 8331000,
"dgraph": [
{
"label": "mutation",
"startOffset": 180332,
"duration": 5844148
},
{
"label": "query",
"startOffset": 8447288,
"duration": 6132
}
]
}
]
}
},
"queryCost": 1
}
}