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
254 20 64

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.