A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I have distributors and customers and they are linked used metafields, basically a customer has a metafield of distributorId, and I used to it to create a 1 to many relation, but how can i look it up?
Hi @turqay16 –
Metafields are meant to store additional information about Shopify resources, so you can easily fetch metafield values in your case when fetching the Customers via API. But there is currently no way to do a "lookup by value", e.g. fetch all Customers where DistributorId = 123. You may need to use your own application logic / database for this reverse lookup.
To learn more visit the Shopify Help Center or the Community Blog.
Now it is July 25, 2024, can you still not query the corresponding customer through metaField using shopify API?
Looking forward to your reply.