Query products by metafield value not working/filtering #139
-
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 10 replies
-
Hey @charle-connoringold couple of things to review.
|
Beta Was this translation helpful? Give feedback.
-
Hey @johncraigcole So I realised after reading your comment I made some silly mistakes. As you mentioned, I was calling variant meta fields when I should have been calling product meta fields. The second thing I did was redo all the meta fields to use lowercase namespaces. I wasn't aware this was a problem and can't see it mentions anything about this on the Shopify docs, so would be good if it was on there. Regardless that fixed my problem, so thank you very much 👍. |
Beta Was this translation helpful? Give feedback.
-
@johncraigcole @charle-connoringold I'm actually having this issue today and I'm actually using productMetafield as the filter In my case I'm expecting to see only up to 5 results of product that contain the value "12 Colour Mountains", but instead I'm getting the default products listing without filtering. Note: Using api version 2022-10 Am I missing anything, an insight would be helpful, kind regards! |
Beta Was this translation helpful? Give feedback.
-
So metafield filtering doesn't work without search and discover app? I though I can just use graphql store front api to get this working. |
Beta Was this translation helpful? Give feedback.
-
Hello I got set up "this filter by metafield working with graphql" but when I am expecting 12 results I only manage to fetch 5 products . There are more than 1000 products with this collection. If I create another collection with smaller products like 50 then I manage to fetch all 12 results. Is this bug with store frontend api bug or the limitation?
|
Beta Was this translation helpful? Give feedback.
-
Why isn't metafield filtering available on |
Beta Was this translation helpful? Give feedback.
-
@johncraigcole Do you know if/when we might be able to use operators on meta fields? For example, if we have a weight_in_kg metafield and want to find all products that have a metafield.weight_in_kg value great than 5. Hopefully, that makes sense. |
Beta Was this translation helpful? Give feedback.
-
Is there any way to filter customers like products based on metafield value? |
Beta Was this translation helpful? Give feedback.
Hey @charle-connoringold couple of things to review.
namespace
andkey
in the filter are correct. If these metafields were created with a definition in the admin or API they should be lower case. If the case is wrong it will be as though the filter was not applied.