Category belongs to one Category (self-reference)Category has many ProductHow can I write something like this (with products data loaded for each category level):
Category.query().withGraphFetched('[children.^, products]')
There's no way to do that using string expressions but maybe this works:
const expr = {
products: true,
}
expr.children = expr
Category.query().withGraphFetched(expr)
Most helpful comment
There's no way to do that using string expressions but maybe this works: