i am quite new to dgraph and graphql and trying to define some first queries on my schema.
now i’d like to count edges with a particular predicate but they are nested. could someone give me a hint how to do that?
here some details :
schema:
person → owns → animal.
animal → carriesHorns → boolean.
now i like to count:
how many animals do people own (on average) where the animal carriesHorns is true?
sorry, I think I missed mentioning 1 nesting layer. we have some kind of n-ary relations / reification, therefore the schema is more like
Person - hasRelationship1 - MultirelationConcept
MultirelationConcept - hasRelationShip2- Person
Person - hasBooleanProperty - true
so I do not have to apply the filter the out-edges target of the first subject but on the object of the second (MultirelationConcept - hasRelationShip2- Person(filter boolean property=true))