Hello,
I have a problem to get child object with DQL:
Here is example:
Schema
type <User> {
status
profile
dob
email
}
type <UserProfile> {
firsName
lastName
dob
profile_of
}
<profile>: uid @reverse .
<profile_of>: uid @reverse .
First I create one User object:
{
set {
_:x <email> "alice@ssaa.com" .
_:x <dgraph.type> "User" .
}
}
Then I create the user’s UserProfile
{
set {
_:x <firsName> "Alice" .
_:x <profile_of> <0x13d75> .
_:x <dgraph.type> "UserProfile" .
}
}
But, when I query the user to get profile as well I got blank:
{
q(func: type(User)) {
uid
email
profile {
firsName
}
}
}
{
"data": {
"q": [
{
"uid": "0x13d75",
"email": "alice@ssaa.com"
}
]
}
This is possible with GraphQL @hasInverse, but I cannot do it with @reverse.
How can I get the User object with its profile object?