edgedb-js icon indicating copy to clipboard operation
edgedb-js copied to clipboard

Missing `is` operator

Open jaclarke opened this issue 1 year ago • 2 comments

Describe the bug The is operator (https://www.edgedb.com/docs/stdlib/type#operator::is) is not reflected in the querybuilder. See https://discord.com/channels/841451783728529451/849374705210490900/1107383910498832397 and https://discord.com/channels/841451783728529451/849374705210490900/1060159252821463110

Reproduction

const person = e.select(e.Person, () => ({
  filter_single: { name: "Test" },
}));
const isHero = e.op(person, "is", e.Hero); // errors because there is no "is" overload in `e.op()`

Additional context Possibly blocked on this issue: https://github.com/edgedb/edgedb/issues/5523, that the is operator and other type operators (which we should probably also add to querybuilder?), are currently also missing from introspection in edgedb itself, though we will need special handling for these in the querybuilder anyway since they operate on types instead of objects of a type.

jaclarke avatar May 22 '23 13:05 jaclarke

This is the key thing missing for us in the ts querybuilder. Would love to have it added. Thanks

BKG01 avatar Mar 18 '24 12:03 BKG01

@BKG01

Yeah, this is a painful omission, for sure. Hopefully it suffices to write the queries that need this using the queries generator or manually with strings as we work on iterating on the operators implementation of the query builder generator more generally which will include support for type-level operators like is.

scotttrinh avatar Mar 18 '24 13:03 scotttrinh