Hi,
I’m new to Dgraph and have an issue with getting the values of a relationship. I want to count the amount of children a node has in a lambda function (I know that this is possible without lambda, but this will later be extended with another calculation based on that count) but the children of my node are not available via the parent parameter.
Is this by design and is there a way to achieve this without using graphql/dql in the resolver function?
type Parent {
id: ID!
children: [Child!]! @lambda
}
type Child {
id: ID!
}
and in your lambda
const children = async ({parent: {children}}) => {
// do some math
return number;
}
self.addMultiParentGraphQLResolvers({
"Parent.children": children
})