This is just an example. Let me try to give you another one.
Let’s say we have this schema.
type Brand {
id: ID!
name: String! @id @search
websites: [Website!] @hasInverse(field: brand)
}
type Website {
id: ID!
brand: Brand! @hasInverse(field: websites)
name: String! @id @search
domain: String @search
}
A Brand with `uid: “0x12345” and name: “Test Brand” exist, so to add a new website I do
{
"set": [
{
"Website.brand": {
"uid": "0x12345"
},
"Website.name": "Test Name",
"Website.domain": "domain.com"
"dgraph.type": "Website"
}
]
}
After this mutation I can query the Website and the brand is correct there.
The problem is that when I query the Brand, it doesn’t contain the Website I created.