Tagging Shopify resources
GraphQL
{% if event.preview %}
{% capture customer_json %}
{
"admin_graphql_api_id": "gid://shopify/Customer/12345"
}
{% endcapture %}
{% assign customer = customer_json | parse_json %}
{% endif %}
{% action "shopify" %}
mutation {
tagsAdd(
id: {{ customer.admin_graphql_api_id | json }}
tags: ["some", "new", "tags"]
) {
userErrors {
field
message
}
}
}
{% endaction %}
{% action "shopify" %}
mutation {
tagsRemove(
id: {{ customer.admin_graphql_api_id | json }}
tags: ["tags", "to", "remove"]
) {
userErrors {
field
message
}
}
}
{% endaction %}Logging the results
Last updated
Was this helpful?