I have a bunch of nodes, and in the client I have a value called “status” which is derived from whether or not the nodes have certain predicates. It’s possible the nodes don’t have preceding stage predicates.
Imagine this set of data:
nodes: [{
stage1: true
},
{
stage1: true,
stage2: true
},
{
stage1: true,
stage2: true,
stage3: true
},
{
stage2: true
},
{
stage1: true,
stage3: true
}
]
Now let’s say status is “closed” if a node has stage3, “active” if has stage2, and “ready” when it has stage1. Is there a way to query this data and sort by status like this?
Obviously I could just go in and manually set the ‘status’ value for each node, but I’m curious if there’s a way to achieve it using query variables.