Using the schema of :
type Person {
id: ID!
name: String!
children: [Person] @hasInverse(field: "parents")
parents: [Person] @hasInverse(field: "children")
}
And performing an insertion of 4 objects → Grandparent (
), Parent (
), Child (
), ParentSibling_0 (
) followed by adding the offspring-wise relationship as follows:
→
→ 
…\ → 
And running a first degree query :
query FirstDegreeRelation {
queryPerson {
id
name
parents {
id
name
}
children {
id
name
}
}
}
I got the following (correct result) :
"data": {
"queryPerson": [
{
"id": "0xc352",
"name": "Grandparent",
"parents": [],
"children": [
{
"id": "0xc353",
"name": "Parent"
},
{
"id": "0xc355",
"name": "ParentSibling_0"
}
]
},
{
"id": "0xc353",
"name": "Parent",
"parents": [
{
"id": "0xc352",
"name": "Grandparent"
}
],
"children": [
{
"id": "0xc354",
"name": "Child"
}
]
},
{
"id": "0xc354",
"name": "Child",
"parents": [
{
"id": "0xc353",
"name": "Parent"
}
],
"children": []
},
{
"id": "0xc355",
"name": "ParentSibling_0",
"parents": [
{
"id": "0xc352",
"name": "Grandparent"
}
],
"children": []
}
]
}
Your schema is correct, however I think you might have done an accidental parent relationship between the uncle and the child. Try modelling your vertex edge relationships properly ( for eg: a person who’s been divorced will have a divorced [ID] subfield and an inverse relationship with the ID of the person he has divorced. Parents can have an enum subfield to cast them as either biological parenthood or adoptive parenthood, etc.)