Filter nodes by connected nodes?

I have a knowledge graph, where each Idea (graphql type) represents an idea and each Relation (graphql type) represents an edge (connection) between ideas.

In a query, is it possible to filter nodes by properties of nodes to which they are connected?

More concretely: I have particular Idea representing the category “people” and another representing “from Dallas.” Any particular person or thing P in the knowledge web is represented by an Idea node. P is connected to the “people” and/or “from Dallas” ideas whenever P is a person or from Dallas, respectively.

Is there a query that would fetch nodes (Ideas) representing people from Dallas?

I only see, from GraphQL and DGraph documentation and from Dgraph’s auto-generated operations (based on my schema), how to write simpler queries—queries based only on properties of the type which I am querying, rather than connected nodes.

It is possible with DQL in a single query. It is possible right now in GraphQL with multiple queries, but there is a RFC and work being done towards this:

Ok, thank you–nested filters in GraphQL would be helpful.

1 Like