Hi @cocodrino!
You’re almost there. So I have created a small working example below which you could try out
- Schema file:
scalar (
age: int @index
name: string @index
)
type Person {
name: string
age: int
address: string
boss_of: uid @reverse
}
- Data loading:
curl localhost:8080/query -XPOST -d $'mutation {
set {
<a> <name> "alice" .
<b> <name> "bob" .
<a> <age> "10" .
<b> <age> "20" .
<b> <boss_of> <a> .
<a> <address> "London" .
<b> <address> "San Francisco" .
}
}'
- Some simple queries that you could do:
#Q1
{me(id:a) { name, ~boss_of {name} }}
Result:
{"me":[{"name":"alice","~boss_of":[{"name":"bob"}]}]}
#Q2
{me(gt(age,15)) { name, boss_of {name} }}
Result:
{"me":[{"boss_of":[{"name":"alice"}],"name":"bob"}]}
#Q3
{me(anyof(name, "alice bob")) { name, boss_of {name}, ~boss_of {name} }}
Result:
{
"me": [
{
"boss_of": [
{
"name": "alice"
}
],
"name": "bob"
},
{
"name": "alice",
"~boss_of": [
{
"name": "bob"
}
]
}
]
}
Let us know if you have other questions!