Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Error in productCreate mutations ProductInput.claimOwnership.

Solved

Error in productCreate mutations ProductInput.claimOwnership.

Itachi_Uchiha
Shopify Partner
26 0 1

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)",

 

 

 

 

Accepted Solution (1)

SBD_
Shopify Staff
1831 273 420

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 

View solution in original post

Replies 2 (2)

SBD_
Shopify Staff
1831 273 420

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 

Itachi_Uchiha
Shopify Partner
26 0 1

I see, thanks for pointing in out. I was using the 2023-07 version.