Have your say in Community Polls: What was/is your greatest motivation to start your own business?
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 query a Customer by Metafield Using GraphQL API 2023-04?

How to query a Customer by Metafield Using GraphQL API 2023-04?

Lederer
Shopify Partner
9 1 1

Hi,

 

I want to query a Customer filtered by it's metafield key/value. How can I achieve this?

Replies 2 (2)

Shayne
Shopify Staff (Retired)
254 20 48

There's no way to filter directly when querying customers, but segmentation will do what you're looking for! For your convenience, here's a link with some information on customer segments, which conveniently has an API that you can use to manage the segments and query customers who are a part of that segment.

Hope this helps!

Shayne | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Lederer
Shopify Partner
9 1 1

Thanks a lot! That looks like it could work for my needs. I will try that and accept the answer if it works.