I have a schema, where, a person can subscribe to multiple services “service1”, “service2” etc…
Starting with 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.
Does this mean that cascade works only in query and not in upsert block?
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.
}
}