Customize a resource picker for product tags

Ngocuongf123
Shopify Partner
3 0 0

Actually, this was part of my internship test at a company that specializes in developing applications on Shopify. I'm having trouble creating a "picker" for "productTags". Unfortunately for me there is no Resource Picker for productTags. I think the first option is to use GraphQL to upload all productTags and then put them into Polaris Combobox. This solution is difficult in that I realize I need to use the Storefront API to get productTags and I'm not very proficient, I've only dabbled in the Admin API a little. I considered the second option, which is to upload all productTags attributes when retrieving the products resource using GraphQl. Then, I will use JS's Set data type to filter out all duplicate tags. In the end I realized both options were problematic because with GraphQl it seemed impossible and undesirable to fully retrieve any resource. Like always having a condition like "first: 10", I understand this is a smart strategy for things like pagination. Anyway, I still have to complete this exercise in the most optimal way, so I want to ask you a solution. Below is an illustration of the request:

Screenshot 2024-04-24 223722.png

Replies 0 (0)