FROM CACHE - en_header

GraphQL clear CompareAtPrice

New Member
1 0 0

Hi everyone,

we are developing an external app that can import some products into our Shopify or change some data of the existing ones (price or other).

The problem we are facing is that we can't in any way clear the CompareAtPrice field, but we might need to.

Take this case:


Current productVariant prices:

  • Price = 100
  • CompareAtPrice = 120


From our import, the price should become 120, without any discount, so we should set Price to 120 and CompareAtPrice to "blank".

We tried many mutations, setting CompareAtPrice to 0, '', nil, ... but nothing worked.


How should we fix that case? We really need to be able to update our prices eventually removing the discount.


That's our mutation (example)

id: \"gid://shopify/ProductVariant/..\",
title: \" Variant title\",
sku: \"Variant SKU\",
barcode: \"Variant Barcode\",
price: \"100\",
compareatprice: nil,
field message


What should we do?


thanks all!

Replies 4 (4)
Shopify Expert
4 0 2

Hey - Did you manage to solve this?


Clearing fields in general is pretty key. 🙂


New Member
2 0 0

I have the same problem.

If we don't wont a compareAtPrice anymore, we must be able to clear it out.

I can't find any Rest API or GraphQL instruction for this.

Shopify Partner
1026 85 272

This worked for me using the GraphQL API. See below. Hope this helps!


Shopify Partner
14 0 2

Nice find! @Gregarican 
Setting the field to null clears it!
Works with bulk mutations also.