Deleted variant still returning through API call

Topic summary

• Issue: After deleting a product variant via GraphQL, the storefront no longer shows it, but an immediate API query still returns the variant. The goal is to detect when no variants remain to change product status from Active to Draft.

• Clarification: In Shopify, a product always has at least one variant (a specific option like size or color). Deleting the only variant effectively deletes the product; if there are multiple and you delete one, the API should show fewer variants; if all are removed, Shopify automatically creates a “default” variant.

• Implication: Seeing a variant in the API after deletion may reflect Shopify’s auto-created default variant rather than stale data. There is no true “zero variants” state for a product.

• Outcome/Next steps: No extra deletion step was identified. Verification should account for the default-variant behavior when determining variant counts and product status.

• Status: Partially resolved. The platform rule explains the persistent variant in API responses; the thread does not address any potential timing/consistency lag beyond this behavior.

Summarized with AI on January 30. AI used: gpt-5.

Dear Experts,

I am deleting product variant by grpahQL command. After executed GraphQL delete command, when we visit the webpage we see the deleted variant is disappeared under that product which is as expected. But if I send the API command immediately to know the product variant list, the deleted variant still showing under that product in the API response.

After deleted variant we need to perform another command as if there are no variant exists under that product, product status should be updated from “Active” to “Draft”. But we could not determined through API call correctly the number of variant available for this product.

Could you please help us after deleted any variant using graphql how to verify through API call the variant is deleted? Also am I missing any additional steps that is required to delete variant so that API call doesn’t count that deleted variant info?

Thank you,

Kamal Hossain

Hi Khossain,

A product always has at least 1 variant, even if it doesnt have any variants..I know that doesn’t make much sense but that is the way it is.

So if your product only has one variant and you delete it, then really you are deleting the product itself. If there are 2 variants and you delete one of them then your api call should return only 1 variant. If you remove both of those variants, then shopify will automatically create a “default” variant.

Hope that helps,

Cheers,

Gary