I'm getting storefrontId instead of gid for collections (GraphQL)

Highlighted
Shopify Partner
9 0 2

Hi. 

I'm trying to get some collections gid's using GraphQL. Everything works good when I'm trying to get them using GraphQL app. But when I'm trying to get them using my private app - I receive storefrontId instead of gid.

 

Here's my query:

{
  collections(first: 200, query: "title:Bebe OR title:Enfant") {
    edges {
      node {
        id
      }
    }
  }
}

Everything works fine in GraphQL App:

34.png

But not fine in Postman, for example:

35.png

I tried different methods and API versions, but nothing helped.

Please, help me with this problem

0 Likes
Highlighted
Shopify Staff
Shopify Staff
582 70 127

Hey @mashkovtsev,

 

The results you're seeing appear to be from the storefront API. Can you confirm that you're using basic auth and making your calls to https://{{store_name}}.myshopify.com/admin/api/{{version}}/graphql.jsonin Postman?

 

The admin graphQL API uses basic auth + the admin link above to communicate with Shopify. In you're using an access token and missingadmin in the URL, that means you're making calls to the storefront API and you'll want to switch to the admin API to get the expected collection_ids.

 

If you already are using the admin API and still getting unexpected results, please provide the api_client_id of your app or the x-shopify-request-id from the response headers in Postman, and we can investigate further.

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

0 Likes