Anchor to tagsRemovetags
tagsRemove
mutation
Remove tags from an order, a draft order, a customer, a product, or an online store article.
Anchor to Arguments
Arguments
- •ID!required
The ID of the resource to remove tags from.
- Anchor to tagstags•[String!]!required
A list of tags to remove from the resource in the form of an array of strings. Example value:
["tag1", "tag2", "tag3"]
.
Was this section helpful?
Anchor to TagsRemovePayload returnsTagsRemovePayload returns
- Anchor to nodenode•
The object that was updated.
- Anchor to userErrorsuser•
Errors [UserError!]! non-null The list of errors that occurred from executing the mutation.
Was this section helpful?
- Remove tags from a customer
- tagsRemove reference
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation removeTags($id: ID!, $tags: [String!]!) {
tagsRemove(id: $id, tags: $tags) {
node {
id
}
userErrors {
message
}
}
}`,
{
variables: {
"id": "gid://shopify/Customer/544365967",
"tags": [
"Bob"
]
},
},
);
const data = await response.json();
mutation removeTags($id: ID!, $tags: [String!]!) {
tagsRemove(id: $id, tags: $tags) {
node {
id
}
userErrors {
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation removeTags($id: ID!, $tags: [String!]!) { tagsRemove(id: $id, tags: $tags) { node { id } userErrors { message } } }",
"variables": {
"id": "gid://shopify/Customer/544365967",
"tags": [
"Bob"
]
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation removeTags($id: ID!, $tags: [String!]!) {
tagsRemove(id: $id, tags: $tags) {
node {
id
}
userErrors {
message
}
}
}`,
{
variables: {
"id": "gid://shopify/Customer/544365967",
"tags": [
"Bob"
]
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation removeTags($id: ID!, $tags: [String!]!) {
tagsRemove(id: $id, tags: $tags) {
node {
id
}
userErrors {
message
}
}
}`,
"variables": {
"id": "gid://shopify/Customer/544365967",
"tags": [
"Bob"
]
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation removeTags($id: ID!, $tags: [String!]!) {
tagsRemove(id: $id, tags: $tags) {
node {
id
}
userErrors {
message
}
}
}
QUERY
variables = {
"id": "gid://shopify/Customer/544365967",
"tags": ["Bob"]
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"id": "gid://shopify/Customer/544365967",
"tags": [
"Bob"
]
}
Response
JSON{
"tagsRemove": {
"node": {
"id": "gid://shopify/Customer/544365967"
},
"userErrors": []
}
}