A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Dear Shopify Support Team,
I hope this message finds you well.
I encountered an issue while trying to retrieve the weight data for a product variant using the GraphQL Admin API. Despite following the example inputs provided in the documentation, I received the following error message: "Field 'weight' doesn't exist on type 'ProductVariant.'"
Could you please advise on the correct method to access the weight data for a variant?
Thank you in advance for your assistance. I look forward to your guidance.
Best regards,
Rick
Solved! Go to the solution
This is an accepted solution.
Following:
I am seeing the same error on versions 2024-07 and 2024-10 (the docs show the weight and weightUnit as existent)
Noting these fields can be accessed if you revert the version to version 2024-04
rgds
Paul
This is an accepted solution.
Hi@RickUp
query {
productVariant(id:"gid://shopify/ProductVariant/45742865645790") {
barcode
id
inventoryItem{
id
measurement{
id
weight{
unit
value
}
}
}
inventoryQuantity
displayName
title
price
compareAtPrice
sku
}
}
This is an accepted solution.
Following:
I am seeing the same error on versions 2024-07 and 2024-10 (the docs show the weight and weightUnit as existent)
Noting these fields can be accessed if you revert the version to version 2024-04
rgds
Paul
This is an accepted solution.
Hi@RickUp
query {
productVariant(id:"gid://shopify/ProductVariant/45742865645790") {
barcode
id
inventoryItem{
id
measurement{
id
weight{
unit
value
}
}
}
inventoryQuantity
displayName
title
price
compareAtPrice
sku
}
}