chore(index): return ids only (#12543)

This commit is contained in:
Carlos R. L. Rodrigues
2025-05-20 11:16:02 -03:00
committed by GitHub
parent fca5ad77b4
commit ebe5cc7acd
12 changed files with 92 additions and 16 deletions
@@ -536,6 +536,42 @@ describe("IndexModuleService query", function () {
])
})
it("should query all products ordered by price returning only ids", async () => {
const { data } = await module.query({
fields: ["product.*", "product.variants.*"],
idsOnly: true,
pagination: {
order: {
product: {
variants: {
prices: {
amount: "DESC",
},
},
},
},
},
})
expect(data).toEqual([
{
id: "prod_2",
variants: [],
},
{
id: "prod_1",
variants: [
{
id: "var_1",
},
{
id: "var_2",
},
],
},
])
})
it("should query products filtering by variant sku", async () => {
const { data, metadata } = await module.query({
fields: ["product.*", "product.variants.*", "product.variants.prices.*"],