Skip to content

Conversation

@tyt2y3
Copy link
Member

@tyt2y3 tyt2y3 commented Oct 30, 2025

No description provided.

tyt2y3 and others added 14 commits October 24, 2025 21:29
Seaography already supports 'and' and 'or' operators on filters. This
commit adds a 'not' operator, which takes a filter object as an argument
and maps this onto the corresponding Condition not() method in SeaORM.

This is particularly useful for using operators that do not have an
inverse version, such as array contains. For example, in one use case,
we want to select all entities whose tags field does _not_ contain a
specific value:

    {
      runs(filters: {
          not: { tags: { array_contains: ["disabled"] } }
      }) {
        nodes {
          id
          name
          status
        }
      }
    }
basic_type_suffix: "Basic".into(),
},
entity_query_field: EntityQueryFieldConfig {
combine_is_null_is_not_null: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

now being enabled by default

Comment on lines +351 to +352
$builder =
$builder.register_related_entity_filter::<$module_path::Entity>(related_entity_filter);
Copy link
Member Author

Choose a reason for hiding this comment

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

this implements "filter by related entity"

sea_orm::query::Condition::any().add(sea_orm::sea_query::ConditionExpression::SimpleExpr(
sea_orm::sea_query::SimpleExpr::Constant(sea_orm::sea_query::Value::Bool(Some(false))),
))
sea_orm::query::Condition::any().add(sea_orm::sea_query::Expr::val(false))
Copy link
Member Author

Choose a reason for hiding this comment

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

Small change to the underlying types

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.

3 participants