feat: multiple conditions on query rules#1171
Conversation
| /** | ||
| * Conditions of the rule, expressed using the following variables: pattern, anchoring, context. | ||
| */ | ||
| readonly conditions?: readonly Condition[]; |
There was a problem hiding this comment.
It should be a disjunct union: { condition } | { conditions } with required in either case. That way you can’t have an object with both condition & conditions
There was a problem hiding this comment.
What does a query rule without condition mean? One of them is required, no?
There was a problem hiding this comment.
@Haroenv No. You can the only required files are: objectID, and consequence. This is quite often used by people that want to apply a query rule all the time.
If you agree, I would to prefer to keep the rule typing just simple like this. We usually don't go that far with types, like possible combinations of key in rules, etc.
There was a problem hiding this comment.
Agree with @nunomaduro on this: we don't go that far as enforcing the mutual exclusion here since the engine does not either.
| /** | ||
| * Conditions of the rule, expressed using the following variables: pattern, anchoring, context. | ||
| */ | ||
| readonly conditions?: readonly Condition[]; |
There was a problem hiding this comment.
Agree with @nunomaduro on this: we don't go that far as enforcing the mutual exclusion here since the engine does not either.
This pull request adds the possibility of passing multiple conditions on query rules.
Closes #1170.