Skip to content

Boolean expressions treated weirdly for possibly more than one element returned by an expression in a FILTER clause warning #9098

@jackfischer

Description

@jackfischer
  • Gel Version: 6.11
  • Gel CLI Version: 7.8.0

This is obviously extremely minor. Flagging in case it is a hint of a bigger problem.

  1. default.gel has just filter .is_active
$ gel migration create
warning: QueryError
     ┌─ /Users/jack/dev/app/dbschema/default.gel:1382:20
     │
1382 │             filter .is_active
     │                    ^^^^^^^^^^ possibly more than one element returned by an expression in a FILTER clause
...
  1. uncomment, default.gel has filter .is_active = true
$ gel migration create
did you alter...

The = true seems irrelevant here? Hence the weirdness

Schema:

type FoundationModel {
        single link activePrice := (
            select .<FoundationModel[is FoundationModelPrice]
            filter .is_active # = true
            order by .startDate desc
            limit 1
        );
}
type FoundationModelPrice {
        required single link FoundationModel: FoundationModel;
        required property startDate: datetime;
        property endDate: datetime;
        required property is_active := ((.startDate < datetime_of_statement() ) and ((not exists .endDate) or (.endDate > datetime_of_statement())) ?? false);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions