GraphQL Admin API access scopes - publications & channels

originmaster
Tourist
4 0 3

Hi everyone,

 

Using the Shopify GraphiQL App I have access to channels and I can successfully make a request for publications - for example:

 

{
  publications (first: 10){
    edges {
      node {
        id
        name
      }
    }
  }
}


Unfortunately when making the same request via the GraphQL Admin API I get "access denied". I have tried adding  "read_channels" and "read_publications" access scopes to no avail. I need to be able to publish newly created products to the Online Store but it seems that I can't do this without the Publication ID.

 

Is there any way to successfully request publications via the GraphQL Admin API? 
And also, is there a way to publish to multiple sales channels via the API?

hassain
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 135

Hey @originmaster ,

 

The "read_publications" access scope you are referring to is not publicly available for 3rd party apps (which is why it is not present in our Access Scopes documentation:https://shopify.dev/docs/admin-api/access-scopes). This scope is only available for internal Shopify apps, which is why the Shopify GraphiQL App can make that query but 3rd apps cannot.

 

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
originmaster
Tourist
4 0 3

Thanks for the reply @hassain

 

I assume this means there's no way to publish newly created products via the API without knowing the online store publicationID in advance?

 

And there is no way to publish to other channels via the API?


 

Louise_Elmose_H
Shopify Partner
65 2 7

Hi,

 

I am interested in the answer to this question as well - is it possible or not to publish new products with the GraphQL API?
Would you please explain why, if it is not possible to publish via the GraphQL API? It is possible via the REST API, and Shopify recommends using GraphQL over REST. In that case the GraphQL API should have at least the same set of features as the REST API.

Thanks,

-Louise

Louise_Elmose_H
Shopify Partner
65 2 7

Ok I see you can use the deprecated field "published" on ProductInput as a workaround for now, although I would rather use a non-deprecated option.

Please let me know what the non-deprecated solution for publishing with the GraphQL API is.

Thanks,

-Louise