Creating a custom script
{%- comment -%}Start REST and GraphQL definitions{%- endcomment -%}
{% capture mutation %}
mutation tagsAdd($id: ID!, $tags: [String!]!) {
tagsAdd(id: $id, tags: $tags) {
node {
id
}
userErrors {
field
message
}
}
}
{% endcapture %}
{%- comment -%} Feed compiler with dummy values to evaluate permissions required.{%- endcomment -%}
{% if mode.compiler %}
{% json dummy_mutation_variables %}
{
"id": "gid://shopify/Order/123456",
"tags": "test"
}
{% endjson %}
{% assign result = mutation | graphql: dummy_mutation_variables %}
{% endif %}
{%- comment -%}END REST and GraphQL definitions{%- endcomment -%}
Last updated