I am running into a persistent issue where I am unable to set the Standard Product Category for any products. We have tried multiple documented approaches, as well as the solution listed here, and every attempt fails with an API error, suggesting the feature may be configured differently or is unavailable for our store’s API.
Here is a summary of my attempts:
Attempt 1: Using the productSet Mutation
Based on examples from above, we tried using the productSet GraphQL mutation.
GraphQL Mutation Sent:
GraphQL
mutation productSetCategory($input: ProductSetInput!) {
productSet(input: $input) {
product {
id
}
userErrors {
field
message
}
}
}
Variables Sent:
JSON
{
"input": {
"id": "gid://shopify/Product/7972531732550",
"category": "gid://shopify/ProductTaxonomyNode/2111"
}
}
JSON Error Received from API: The API rejected this call, stating that the category ID was invalid.
JSON
{
"errors": [
{
"message": "Invalid product_taxonomy_node_id",
"path": [
"productSet"
],
"extensions": {
"code": "INVALID_PRODUCT_TAXONOMY_NODE_ID"
}
}
]
}
Attempt 2: Searching for the Correct Category ID
To debug the “Invalid ID” error, I then tried to query the API to ask it for the correct category GID for “T-Shirts”.
GraphQL Query Sent:
GraphQL
query {
productTaxonomyNodes(query: "T-Shirt") {
edges {
node {
id
name
}
}
}
}
JSON Error Received from API: The API rejected this query, stating that the entire feature doesn’t seem to exist on our query root.
JSON
{
"errors": [
{
"message": "Field 'productTaxonomyNodes' doesn't exist on type 'QueryRoot'",
"extensions": {
"code": "undefinedField",
"typeName": "QueryRoot",
"fieldName": "productTaxonomyNodes"
}
}
]
}
My Question
These errors strongly suggest that the Standard Product Category feature is not accessible via the API for my store. Any ideas if I’m missing a function or of there’s an API permission that I’m not seeing? I’ve been round in circles on this a few times now over the last few weesk.