All things Shopify and commerce
Hello,
I am using Storefront API to get the order history of the users, then I list the different line_items. But some line_items have the variants object to null, I need this object because it contains several information.
Do you know why some line_item have the variants object to null?
Thank you.
Fair to assume that the items missing no longer exist in the shop? So the reference being nullified would be a reflection of that.
Hello Jason,
Thank you for your answer but this is not the case for all products. Some old products are no longer available, but others recent products are still available but with an empty object variant.
Any news on this? I'm having exactly the same problem
Items exists in the shop, status is set to active.
But the variants field returns null.
Also - if it was a reflection of the item missing or no longer existing howcome its returning valid data for title etc?
According to Shopify docs:
Deleted objects are not available in the API. The product variant ID is the only detail you can get when a product variant is deleted. Other details are not available.
https://help.shopify.com/en/manual/shopify-flow/reference/triggers/product-variant-deleted#api-detai...
I see that REST API returns the variantid but other details are null. whereas GraphQL returns variant null
We also are seeing this when using the checkoutCreate storefront mutation, no errors no issues, but this is what is returned for the checkout lineItems:
"lineItems": {
"nodes": [
{
"title": "Personalized Cartoon Phone Case",
"quantity": 1,
"variant": null
}
]
}
Any ideas? The product is available in the custom app's sales channel.
We can also query this ProductVariant node from the storefront api with no issues as well.
This only happens with random variants and we can't seem to figure out why.
Is there an update on this??
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025