Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to filter customer query by matafields

How to filter customer query by matafields

_tim_
Shopify Partner
6 0 0

I want to get a set of customer who has a specific metafield via API

 

for example I want to query all customer that has a metafield customer.metafields.profile.age  =  20

Is it possible with REST API or GraphQL? 

In GraphQL, metafield was not in the query parameters. 

 

Thank in advance

Replies 2 (2)

BrianLegault
Shopify Staff (Retired)
2 0 0

Hi @_tim_,

Thanks for reaching out regarding this use-case about querying by Metafield values. At this time, it is not supported in REST nor in GraphQL APIs. We have taken this as feedback, as we see the value of this capability.

To learn more visit the Shopify Help Center or the Community Blog.

_tim_
Shopify Partner
6 0 0

Any other work around this? 

 

Do I have to query for all the metafields first, then loop around to fetch  all customers having that metafield?