edgedb-js
edgedb-js copied to clipboard
Extend splats in querybuilder to match edgedb syntax
(Implemented in EdgeDB here: https://github.com/edgedb/edgedb/pull/5080)
- [ ] Add double star
['**']that contains all properties and links - [ ] Try to add an overload to
e.isto make this possible for polymorphic splats:
e.select(e.Person, () => ({
...e.is(e.Hero)['*']
}));
// Currently have to do this:
e.select(e.Person, () => ({
...e.is(e.Hero, e.Hero['*'])
}));
In the meantime, if you need all of the links of an object, you'll have to manually add them, but you can use the single splat to make it a little easier to write:
e.select(e.Movie, (movie) => ({
...movie["*"],
characters: (c) => ({ ...c["*"] }),
profile: (p) => ({ ...p["*"] }),
});