GraphQL productCreate mutation gets X-Shopify-API-Deprecated-Reason header

Solved
Highlighted
Shopify Partner
14 0 4

My api calls for productCreate  (and also for productVariantCreate) are getting Deprecation headers.  I cannot determine what part of the request is deprecated.

 

When I send the same request to my dev store using GraphQL explorer there are no notices for any deprecated fields.

 

I thought perhaps I had an old version of the explorer loaded, so I deleted and reloaded it.   

 

in scanning through the docs, I found a field I was not using that was listed as deprecated and I added that to see if I could get the app to tell me that that field was deprecated, but that didn't work either.  

 

Support has been no help, only telling me that everything is working properly.  What I need to be able to do is find out what parts of my call is deprecated so I can change it.  They merely send me links to docs I have read already and told me to post here.

 

I am using productCreate mutation as described here:

https://www.shopify.ca/partners/blog/multi-location_and_graphql

 

here is an example mutation which is getting the deprecated response header.

mutation {
  productCreate(input: {
    title: "NIKE  - 449788022", 
    descriptionHtml: " - MEN'S SHOES  42-MENS L/S TEES", 
    productType: "Staging", 
    vendor: "NIKE", 
    published: false, 
    options: ["size", "width"], 
    metafields: [{
      namespace: "MRproductInfo", 
      key: "ALU", 
      value: "449788022", 
      valueType: STRING}], 
    variants: [{
      price: 39.99, 
      sku: "38536314-0acb-4d3f-b8ff-a0f2014d2c75", 
      inventoryManagement: SHOPIFY, 
      weightUnit: POUNDS, 
      weight: 1, options: ["M", ""], 
      metafields: [{
          namespace: "MRproductInfo", 
          key: "ALU", 
          value: "449788022-M-", 
          valueType: STRING}, {
            namespace: "MRproductInfo", 
            key: "ItemNumber", 
            value: "400000881201", 
            valueType: STRING}], 
      inventoryQuantities: [{
          locationId: "gid://shopify/Location/3496640539", 
          availableQuantity: 0}]}]}) {
    product {
      id
    }
    userErrors {
      field
      message
    }
  }
}

 

any help will be greatly appreciated.

 

thanks in advance

 

Roy.

 

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

This is an accepted solution.

Hi @rplum ,

 

Your mutation is currently using two fields in the productCreate input that are deprecating:

 

First, productInput.published - This argument is deprecated: Use PublishablePublish instead. (https://shopify.dev/docs/admin-api/graphql/reference/mutation/input-object/productinput)

 

Secondly, productInput.productVariantInput.inventoryManagement - This argument is deprecated: Use tracked attribute on inventoryItem instead. (https://shopify.dev/docs/admin-api/graphql/reference/mutation/input-object/productvariantinput)

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Shopify Partner
14 0 4

Hassain

 

Thanks, that is helpful.

 

I am wondering why the Graph QL Explorer app is not flagging deprecated fields for me as described in the deprecation practices documentation.  Any ides there?

 

Take care,

 

Roy.

0 Likes