Get products based on catalogs that are assigned to a company location ID

Topic summary

Goal: Retrieve products associated with a Catalog that’s assigned to a specific Company Location in Shopify (Admin GraphQL).

Proposed approach:

  • Query catalogs with a filter on company_location_id, then traverse to products.
  • A GraphQL example was provided along with the Shopify documentation link for catalogs.

Issue encountered:

  • The initial query returned zero results despite existing records.

Latest update/resolution:

  • Removing the “gid://shopify/CompanyLocation” prefix from the location identifier in the filter yielded results, implying the filter expects the raw ID rather than the full GID (global ID) string.

Outcome and status:

  • Tentatively resolved by using the non-GID location ID in the query filter.
  • Further testing is planned; the solution is expected to be marked accepted if it holds.

Notes:

  • A code snippet and the docs link were central to the troubleshooting.
Summarized with AI on January 15. AI used: gpt-5.

When a Location is assigned to a Catalog in Shopify
The ability to get the products associated to the Location’s catalog

Hi there :waving_hand:

Would a query similar to the following be sufficient?

{
  catalogs(first: 10 query:"company_location_id:

You can review the catalog [documentation here.](https://shopify.dev/docs/api/admin-graphql/2023-10/queries/catalogs)

Hi, thanks for replying.

I tried exactly like this but for some reason it’s always returning 0 even having records.

I guess it worked. I tried removing the “gid://shopify/CompanyLocation” from string.
I’ll do some testing and return to mark the solution as accepted. Thanks