Second Product.All() call uses previous call's filters?



If I make a Product.All() call after another call which had a filter, it still includes all the filters.

Take this example code:

const first = await Moltin.Products.All()
console.log("First 'all' result",

const second = await Moltin.Products.Filter({ eq: { slug: "x" } }).With(["category", "main_image"]).All()
console.log("One product result",

const third = await Moltin.Products.All()
console.log("Second 'all' result",

If I run that with request logging on, I get this:

Fetch finished loading: OPTIONS "".
First 'all' result 34

Fetch finished loading: OPTIONS ",main_image&filter=eq(slug,x)".
One product result 0

Fetch finished loading: OPTIONS ",main_image&filter=eq(slug,x)".
Second 'all' result 0

Is this intended? Is there some way to clear filters or something? It feels super strange…


Hi @damien

This appears to be a bug with class inheritance with the JS SDK. I’ve logged this internally so we can push out a fix.

Thanks for flagging this :smile: and apologies for the inconvenience caused.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.