cubiql icon indicating copy to clipboard operation
cubiql copied to clipboard

Recursive boolean composition?

Open RickMoynihan opened this issue 6 years ago • 0 comments

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.

RickMoynihan avatar Oct 27 '17 10:10 RickMoynihan