Skip to content

Conversation

nikgraf
Copy link
Collaborator

@nikgraf nikgraf commented Aug 9, 2025

rework filter logic to match public filter logic

  • logic operators are only allowed at the cross-field level
  • re-throw filter error
  • improve tests

follow up to #442

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves filter logic to match public filter logic by restricting logical operators ('not', 'or') to only be allowed at the cross-field level, preventing their use within individual field filters.

  • Adds validation to throw errors when logical operators are used at the field level
  • Removes the 'and' operator restriction and simplifies filter evaluation logic
  • Improves error handling by re-throwing filter validation errors

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/hypergraph/src/entity/findMany.ts Updates filter evaluation logic to restrict logical operators and improves error handling
packages/hypergraph/test/entity/findMany.test.ts Adds new test cases for field-level logical operator validation and updates existing tests
.changeset/mighty-numbers-run.md Adds changeset documentation for the filter logic improvements

@nikgraf nikgraf merged commit 9d22312 into main Aug 9, 2025
6 checks passed
@nikgraf nikgraf deleted the ng/improve-filters branch August 9, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant