cubiql
cubiql copied to clipboard
Recursive boolean composition?
On this pr I noticed that there's a small limitation to the way we handle boolean arguments, that means they don't compose as is usually expected.
e.g. Though you can provide filter arguments to do something like:
{:and {:components ["aaa" "bbb"]} :or {{:components ["zzz" "xxx"]}}
You can't currently do something like this, which would be nice:
{:or [{:and ["aaa" "bbb"] :or ["xxx" "yyy"]}]}
or this which would be nice too (but I think impossible to express with GraphQL types):
{:or ["zzz" {:and ["aaa" "bbb"] :or ["xxx" "yyy"]}]}
We should check if we can also support recursive type definitions for boolean expression objects (this is definitely not possible on fields in GraphQL, but maybe on arguments??).
If the above is possible we may be able to compose boolean expressions arbitrarily by defining an :and-expression
and an :or-expression
along with :and
and :or
for primitives.