Focusing on managing products, variants, and collections through the API.
I was trying to create a product using the productCreate mutation which receives ProductInput. According to the documentation the ProductInput has a field called claimOwnership which has a bundles field that receives Boolean value.
So when I try to use the productCreate mutation using the following query
mutation CreateProduct( # Variables $input: ProductInput! ) { productCreate( # Input data input: $input ) { # Payload product { id title variants(first: 10) { edges { node { id price } } } } userErrors { field message } } } // Variables { "input": { "claimOwnership": { "bundles": true }, "status": "ACTIVE", "tags": "", "title": "title of the product", "variants": [ { "price": "89.99", "compareAtPrice": "99.99", } ] } }
I get the following error:
"message": "Variable $input of type ProductInput! was provided invalid value for claimOwnership (Field is not defined on ProductInput)",
Solved! Go to the solution
This is an accepted solution.
Hey @Itachi_Uchiha
That field's quite new and only available on `unstable` and RC (`2023-10`). I was able to replicate that error on `2023-07` and below. Please double check your API version.
Scott | Developer Advocate @ Shopify
This is an accepted solution.
Hey @Itachi_Uchiha
That field's quite new and only available on `unstable` and RC (`2023-10`). I was able to replicate that error on `2023-07` and below. Please double check your API version.
Scott | Developer Advocate @ Shopify
I see, thanks for pointing in out. I was using the 2023-07 version.