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

This commit is contained in:
Carlos R. L. Rodrigues authored and GitHub committed 2025-05-20 11:16:02 -03:00
1 parent fca5ad77b4
commit ebe5cc7acd
12 files changed
+92 -16

No files matched your search

@@ -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.*"],