Skip to content

Conversation

@peterkelly
Copy link
Contributor

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
    }
  }
}

@peterkelly peterkelly force-pushed the filter-not branch 3 times, most recently from b991085 to 2b39683 Compare October 26, 2025 15:03
@peterkelly peterkelly changed the base branch from main to 1.1.x October 26, 2025 15:03
@peterkelly peterkelly force-pushed the filter-not branch 2 times, most recently from e70c485 to a8eaac6 Compare October 26, 2025 15:15
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
        }
      }
    }
@tyt2y3 tyt2y3 merged commit dc4c404 into SeaQL:1.1.x Oct 27, 2025
7 checks passed
tyt2y3 pushed a commit that referenced this pull request Oct 27, 2025
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
        }
      }
    }
tyt2y3 pushed a commit that referenced this pull request Oct 27, 2025
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
        }
      }
    }
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.

2 participants