GrapQL Admin API issue - Access Denied

Piotr2
Shopify Partner
5 0 0

 

Hi There, 

I'm having a hard time trying to call appInstallations endpoint in GraphQL Admin API

 

My Graphql request looks like this:

{appInstallations{edges{node{id}}}}

 

I've done OAuth authentication and my request contains correct headers (x access token & content-type).

Calling this endpoint requires access_scope = read_apps which is not recognized by Shopify's API. What's going on?

I'm getting:

{    "data": null,

    "errors": [

        {   "message": "access denied",

            "locations": [

                {

                    "line": 1,

                    "column": 2

                }

            ],

            "path": [

                "appInstallations"

            ]

        }

    ],

    "extensions": {

        "cost": {

            "requestedQueryCost": 2,

            "actualQueryCost": 0,

            "throttleStatus": {

                "maximumAvailable": 1000,

                "currentlyAvailable": 1000,

                "restoreRate": 50

            }

    }

    }}

 

Any help is greatly appreciated.

Have a great day!

Piotr

0 Likes
Mike_McLean
Tourist
7 0 1

not sure why you are getting the access denied, but that query is not valid anyways. You have to tell it which app installations you want first or last for instance 

 

{appInstallations(first:2){edges{node{id}}}}

0 Likes
Piotr2
Shopify Partner
5 0 0

Thanks, Mike for your reply.

I couldn't even get to the point when I would get 'bad request'  or something similar. It's access denied all the way. It's strange because the other endpoints work.

I suppose it's something with the access_scope, but read_apps isn't even recognized by Shopify Backend??

Regards

Piotr

0 Likes
Mike_McLean
Tourist
7 0 1

I don't know. Honestly the only reason I popped into this thread is because I can't get the apps to work on graphql with a private app. It works fine in the shopify test app though. The documentation used to say you needed read_false scope, but a developer said that was a bug in the documentation and that you shouldn't need any special scope for it. On mine though I don't get an error I just get a successfull response (200 OK) with an empty body.

0 Likes
Piotr2
Shopify Partner
5 0 0

I'm getting "missing_shopify_permission" which explains everything. This endpoint is restricted :/

0 Likes
Mike_McLean
Tourist
7 0 1

well I would agree with that, but if you install the shopify graphql app it works, so there must be some scope you can request to unrestrict it.

Piotr2
Shopify Partner
5 0 0

you're right Mike, I reinstalled Graphiql app and added new scopes, it works, thanks 

0 Likes
Alex
Shopify Staff
Shopify Staff
1555 81 294

Hey folks.

At the moment the GraphiQL app appears to be inheriting a permission that allows for the visibility of appInstallations that aren't your own. This is not a scope we are intending at this time to give to apps other than this API client, since this API client belongs to Shopify/the merchant.

The GraphQL API documentation is still in beta and we're still looking into how to best surface this info more clearly. You can currently see your own appInstallation via currentAppInstallation on the QueryRoot object.

Cheers.

0 Likes
Piotr2
Shopify Partner
5 0 0

Thank Alex for the reply,

I was interested in this endpoint because I wanted to create an app that would allow merchants to better manage apps they install.

I found myself lost after installing 10+ apps.

  1. When did I install them? 
  2. When does the trial end?
  3. Have I installed this app before?

Unfortunately, Apps page in my Shopify admin panel doesn't provide this information in a clear and consistent way.

Regards

Piotr

 

0 Likes
Jithen_g
New Member
3 0 0

Hi Team,

This API is working fine as expected on the 'Shopify GraphiQL App' but if we try to execute same on postman or curl command it is throwing access denied error. Could you confirm how to use this in the external application other than 'Shopify GraphiQL App' ?

0 Likes