feat(core): tighten filter types per (breaking) #453
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Disallowing field-level logical operators in filters; only allow them at the root cross-field level. Implements #442.
changes I did :-
removed not and or from
EntityFieldFilter<T>
.Root
CrossFieldFilter<T>
continues to support not/or.Runtime : reject not/or/and if provided inside a single field filter.
Evaluator: correctly handles nested or and not at the cross-field level with AND semantics for regular fields.
Tests: updated all filter tests to use root-level not/or and added coverage for combined/nested cases.
Lint: cleaned up type-safe access and formatting.
Examples :-
Before:
{ name: { not: { is: "Jane" } } }
{ age: { or: [{ is: 25 }, { is: 40 }] } }
After:
{ not: { name: { is: "Jane" } } }
{ or: [{ age: { is: 25 } }, { age: { is: 40 } }] }
Notes
No server/docs/deploy changes required.
No public GraphQL filter changes in this PR; this strictly tightens local filtering semantics.
Issue
Closes #442
Checklist
[x] Tests added/updated
[x] Types updated
[x] Lint/typecheck/build pass