"access denied" on publications via GraphQL Admin API

Alistair_H_
Shopify Partner
5 0 3

Hello,

 

I have a private app with all Admin API permissions enabled (and the Storefront API). For some reason, I am unable to retrieve anything related to publications via the GraphQL Admin API. See the following request and response:

 

{
  publications(first: 20) {
    edges {
      node {
        app {
          id
        }
      }
    }
  }
}
{
  "data": null,
  "errors": [
    {
      "message": "access denied",
      "locations": [
        {
          "line": 20,
          "column": 3
        }
      ],
      "path": [
        "publications"
      ]
    }
  ],
  "extensions": {
    "cost": {
      "requestedQueryCost": 42,
      "actualQueryCost": 0,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 1000,
        "restoreRate": 50
      }
    }
  }
}

Anyone have any ideas?

 

Thanks,

 

Alistair

Replies 15 (15)

Alistair_H_
Shopify Partner
5 0 3

Bump.

Josh
Shopify Staff
1134 84 233

Hey @Alistair_H_ , 

 

API access to publications via GraphQL is currently gated behind access to product listings. However, product listing permissions are also only available to sales channels, which private apps cannot be. 

 

Is it the online store that you need to publish to, by chance?

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Alistair_H_
Shopify Partner
5 0 3

Hi @Josh ,

 

The basic outline of the problem is that we have a private app with Storefront API enabled which creates a sales channel under 'Product availability' when editing products. When we are retrieving stuff on the client-side via the Storefront API it is scoped by that sales channel. However, retrieving things via the GraphQL Admin API has no scoping, as you would expect, but we would like to retrieve the channel availability information on individual products or use it when retrieving products. The outcome being that we can apply the same sales channel scoping to our GraphQL Admin API queries.

Josh
Shopify Staff
1134 84 233

Hey again @Alistair_H_ , 

 

I can definitely see the confusion here, and enabling access to the Storefront API when the feature was brand new actually did grant sales-channel-like permissions to private apps. That isn't the case anymore though.

 

The behaviour you're seeing right now is meant to allow you to show/hide certain products or collections from your Storefront API app, but doesn't make your private app a true sales channel either. 

 

Given that it does allow your app to act as a publication though, I do agree that it should grant publication access. I recently created a request to open up publication access to apps with product permissions instead of sales channels with product listing access, so I will add Storefront API apps to the list as well. 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

jarias14
Tourist
3 1 2

Hi @Josh  - has this been fixed? I'm getting access denied as well.

AbeCole
Visitor
2 0 2

+1 - We are currently experiencing the same issue would be nice to be able to specify just returning the products from current 'Private App', one work around I've found is to 'publishedOnCurrentPublication' to the data requested and then filter by that after.

browntaped
Tourist
7 0 4

Is this resolved? even we are facing the same issue.

AbeCole
Visitor
2 0 2

I believe this is still unresolved - for certain it was still this way last time I tested on 06-25-2020

NtTestAlert
Visitor
1 0 1

Nothing beats basing your entire solution to a problem on documentation being at least a bit correct. 
But no, hours of work wasted because private apps are not allowed to access their own publication channel.
Should I create a public app instead and price it at 5000$ per month, so that no one will buy it?

Also, this problem should take around an single man-hour to fix. I guess a year is not enough to squeeze that in..

gaineraid
Visitor
1 0 0

Bump! still nothing on this?

HmmTest111
New Member
4 0 0

so ,how about now?? deal it??

Ken_Ray
Shopify Partner
5 0 1

I'm sorry but this is BS, IMHO... the REST API lets you see if a product is published on a given channel (or 'publication') without needing to have a Shopify Plus subscription. For example, I have some products that are only available on POS and some products that are only available in the online store. I can't use "ACTIVE" or "DRAFT" settings (obviously), and with the REST API I could see if a given product was visible on POS or on the online store or both. But with GraphQL, I can't get that info since my shop is not "Shopify Plus". So now I need to do a mixture of GraphQL and REST; if the REST API is ever retired without this being fixed, I'm in serious trouble!

tomchan
Excursionist
13 0 5

2019 to 2021 Shopify has done nothing to address the problem except making excuses.

They are just big enough to ignore valid requests.

juan3211
Shopify Partner
121 0 32

Hi Shopify, no solution, two years, no answer,.... do you exist?

juan3211
Shopify Partner
121 0 32

Two years and a half, no answer.....