how to use the newest verison of productcreate graphQL mutation?

Highlighted
Shopify Partner
18 0 1

I m using productcreate graphQL mutation to create new products.

 

But I don't get how to set the publications 

https://shopify.dev/docs/admin-api/graphql/reference/mutation/productcreate?api[version]=2020-01

 

 

It's all says deprecated!  

 

And I checked  publishabelPushlish mutation  

 

this is means I need send two mutations to create a product?

 

also if I wanna use publishabelPushlish , I need variable like 

{
  "id": "Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=",
  "input": [
    {}
  ]
}

I get ID should be my product ID, which is returned from my first step.(correct me if  I was wrong)

but Where do I get the input?  where do I get the publicationID?

 

because when I try to query publications on my store, I got "access denied"

 

 "errors": [
    {
      "message": "access denied",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "publications"
      ]
    }
  ],

Someone can explain to me how does it work, please...

0 Likes
Highlighted
Shopify Staff
Shopify Staff
491 97 88

Hi @Nathanhahaha 

 

You can use productCreate no problem, but as you've seen accessing publishablePublish requires write_publications scope. At this time, we are unable to grant access to these scope requests to public/published apps. If you are on the Plus Plan and If your app is private, you will want to speak with your Merchant Success Manager. As a partner, you can subscribe to our changelog for further updates at this link here: https://developers.shopify.com/changelog

 

Are you looking to publish only to the Online Store?

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


0 Likes
Highlighted
Shopify Partner
18 0 1

thanks, @vix 

 

All I need is after uploaded a product via Admin API.  I can pull it via StoreFront API. If we can't sign the product to my channel, how can we do this? 

 

Do I need to have a plus plan first? 

0 Likes