mutation updateCollectionRules($input: CollectionInput!) {
collectionUpdate(input: $input) {
collection {
id
title
description
handle
ruleSet {
rules {
column
relation
condition
}
appliedDisjunctively
}
}
userErrors {
field
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation updateCollectionRules($input: CollectionInput!) { collectionUpdate(input: $input) { collection { id title description handle ruleSet { rules { column relation condition } appliedDisjunctively } } userErrors { field message } } }",
"variables": {
"input": {
"id": "gid://shopify/Collection/442946009",
"ruleSet": {
"rules": [
{
"column": "IS_PRICE_REDUCED",
"relation": "IS_NOT_SET",
"condition": ""
}
],
"appliedDisjunctively": true
}
}
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation updateCollectionRules($input: CollectionInput!) {
collectionUpdate(input: $input) {
collection {
id
title
description
handle
ruleSet {
rules {
column
relation
condition
}
appliedDisjunctively
}
}
userErrors {
field
message
}
}
}`,
{
variables: {
"input": {
"id": "gid://shopify/Collection/442946009",
"ruleSet": {
"rules": [
{
"column": "IS_PRICE_REDUCED",
"relation": "IS_NOT_SET",
"condition": ""
}
],
"appliedDisjunctively": true
}
}
},
},
);
const data = await response.json();
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 updateCollectionRules($input: CollectionInput!) {
collectionUpdate(input: $input) {
collection {
id
title
description
handle
ruleSet {
rules {
column
relation
condition
}
appliedDisjunctively
}
}
userErrors {
field
message
}
}
}
QUERY
variables = {
"input": {
"id": "gid://shopify/Collection/442946009",
"ruleSet": {
"rules": [{"column"=>"IS_PRICE_REDUCED", "relation"=>"IS_NOT_SET", "condition"=>""}],
"appliedDisjunctively": true
}
}
}
response = client.query(query: query, variables: variables)
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation updateCollectionRules($input: CollectionInput!) {
collectionUpdate(input: $input) {
collection {
id
title
description
handle
ruleSet {
rules {
column
relation
condition
}
appliedDisjunctively
}
}
userErrors {
field
message
}
}
}`,
"variables": {
"input": {
"id": "gid://shopify/Collection/442946009",
"ruleSet": {
"rules": [
{
"column": "IS_PRICE_REDUCED",
"relation": "IS_NOT_SET",
"condition": ""
}
],
"appliedDisjunctively": true
}
}
},
},
});
use Shopify\Clients\Graphql;
$client = new Graphql("your-development-store.myshopify.com", $accessToken);
$query = <<<QUERY
mutation updateCollectionRules($input: CollectionInput!) {
collectionUpdate(input: $input) {
collection {
id
title
description
handle
ruleSet {
rules {
column
relation
condition
}
appliedDisjunctively
}
}
userErrors {
field
message
}
}
}
QUERY;
$variables = [
"input" => [
"id" => "gid://shopify/Collection/442946009",
"ruleSet" => [
"rules" => [{"column"=>"IS_PRICE_REDUCED", "relation"=>"IS_NOT_SET", "condition"=>""}],
"appliedDisjunctively" => true,
],
],
];
$response = $client->query(["query" => $query, "variables" => $variables]);