-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
area/querylang/cascadeRelated to the cascade directive.Related to the cascade directive.kind/bugSomething is broken.Something is broken.status/acceptedWe accept to investigate/work on it.We accept to investigate/work on it.
Description
I have a schema, where,
- one person can own multiple accounts (account1, account2)
- each account is is subscribed exactly one service (account1 -> service1, account2 -> service2)
For a user id say “1”, I want to get his “owns” predicate, which has subscribed to “service1”
Below query with @cascade works fine, and I get exactly one uid
{
my_activities(func: eq(Id, 1)) @cascade {
owns {
uid
subscribedTo @filter(eq(name, "service1"))
}
}
}
But when I use the same query in upsert, behavior is little bit strange. Even with cascade, I see multiple uid being returned
upsert{
query{
my_activities(func: eq(Id, 1)) @cascade {
owns {
subscribedTo @filter(eq(name, "Service1"))
instance as uid
}
}
mutation @if(eq(len(instance), 2) ) {
# this block executes!!!
}
mutation @if(eq(len(instance), 1) ) {
# this block DOESNOT execute. I was expecting this block to be executed.
}
}
Note: See the discussion here https://discuss.dgraph.io/t/bug-in-cascade-directive/5896
Metadata
Metadata
Assignees
Labels
area/querylang/cascadeRelated to the cascade directive.Related to the cascade directive.kind/bugSomething is broken.Something is broken.status/acceptedWe accept to investigate/work on it.We accept to investigate/work on it.