"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

Alistair_H_
Shopify Partner
5 0 3
Josh
Shopify Staff
Shopify Staff
1131 82 198

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?

0 Likes
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.

0 Likes
Josh
Shopify Staff
Shopify Staff
1131 82 198

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. 

0 Likes
jarias14
Tourist
3 1 2

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

AbeCole
New Member
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
New Member
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
New Member
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..