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