Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
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:
But not fine in Postman, for example:
I tried different methods and API versions, but nothing helped.
Please, help me with this problem
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.json
in 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 | Solutions Engineer @ Shopify
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog