A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I'm using this mutation to try to archive products in bulk. However, I can't even get it to accept one. What am I doing wrong here? See query and response below. This ID is most definitely in my product catalogue so I'm not sure what it doesn't like about it.
mutation productChangeStatus($productId: ID!, $status: ProductStatus!) {
productChangeStatus(productId: $productId, status: $status) {
product {
hasOutOfStockVariants
}
userErrors {
field
message
}
}
}
QUERY VARIABLES:
{
"productId": 6597997559942,
"status": "ARCHIVED"
}
Response:
{
"errors": [
{
"message": "Variable $productId of type ID! was provided invalid value",
"locations": [
{
"line": 1,
"column": 30
}
],
"extensions": {
"value": 6597997559942,
"problems": [
{
"path": [],
"explanation": "Invalid global id '6597997559942'",
"message": "Invalid global id '6597997559942'"
}
]
}
}
]
}
Hi @Lawson_Thalmann!
gid://shopify/Product/6597997559942
Mike M (mikerowave) | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit shopify.dev or the Shopify Web Design and Development Blog