App reviews, troubleshooting, and recommendations
I’m encountering an issue with the Shopify GraphQL API when trying to set up customization rules based on customer tags. Here’s the situation:
I’ve created a rule where users can specify a tag for a customer. This involves the following conditions:
The tag is successfully added and saved in the Shopify Admin under Customers Settings. However, when I query the hasTags field in the buyerIdentity.customer object, it is returning false for the hasTag property, even though the tag exists for the customer.
GraphQL Query:
query ($customerTags: [String!]) { buyerIdentity { email customer { email amountSpent { amount } hasTags(tags: $customerTags) { tag hasTag } } } }
run.graphql :
query RunInput($customerTags: [String!], $productTags: [String!]) { cart { discountCodes: attribute(key: "discountCodes") { key value } zoneProvince: attribute(key: "Zone") { key value } cost { totalAmount { amount } totalTaxAmount{ amount } subtotalAmount { amount } } lines { quantity cost{ amountPerQuantity{ amount } compareAtAmountPerQuantity{ amount } } merchandise { ... on ProductVariant { sku weight product { hasTags(tags: $productTags) { tag hasTag } } } } } deliveryGroups { deliveryAddress { provinceCode city countryCode } selectedDeliveryOption { cost { amount } } } buyerIdentity { email customer { email amountSpent { amount } hasTags(tags: $customerTags) { tag hasTag } } } } paymentMethods { id name } paymentCustomization { metafield(namespace: "$app:payment-customization-v2", key: "advance-rules") { value } } }
Result from Extensions Console:
{ "buyerIdentity": { "email": "userxyz@gmail.com", "customer": { "email": "userxyz@gmail.com", "amountSpent": { "amount": "0.0" }, "hasTags": [ { "tag": "TestingC-Tag", "hasTag": false } ] } } }
As you can see, the API is returning hasTag: false for the tag "TestingC-Tag", even though it exists in the Shopify Admin for this customer.
Question:
Why might the hasTags field be returning false for a tag that exists in Shopify Admin? how do i fix reslve it to use hasTag or is there any other solution to use CustomerTags?
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024