GraphQL locations query

Topic summary

A developer encountered an issue where the GraphQL locations query consistently returned an empty array despite having full permissions and visible locations in the admin panel.

Troubleshooting attempts:

  • Another user suggested reformatting the query structure using edges and node syntax
  • Screenshots were shared showing the empty results persisting
  • Verification of store name assignment was confirmed
  • Other queries worked correctly, isolating the issue to the locations query specifically

Resolution:
The root cause was identified: the locations query only returns locations that have the pickup feature enabled. To resolve this, users must enable the pickup option in the “shipping and delivering” settings for each location they want returned in the query results.

Summarized with AI on November 21. AI used: claude-sonnet-4-5-20250929.

Hey,

I’m trying to run this query on GraphiQL

locations(first:100){
nodes{
name
}
}

but it always returns an empty array, although I can see my locations on admin panel also, I have full permission and all other queries work fine.

Hi @NatDev ,

Please change your query to,

{	
  locations(first:100){
    edges{
      node{
        name        
      }
    }
  }
}

Thanks …

Hey Oscprofessional,
still the same problem

Hi @NatDev ,

Try this, It is working

{
  locations(first: 100) {
    edges {
      node {
        name
      }
    }
  }
  collections(first: 10){
    edges{
      node{
        id
      }
    }
  }
}

Thanks…

No, it’s not working.

locations query keeps returning an empty array.

Hi @NatDev ,

Did you assign store name here,

If not please update and try again.

Thanks…

Yes, sure I have store name.

everything is working ok for me all other queries return data correctly except this one.

Hi @NatDev ,

Could you please share store url and credentials so that I can run the query and check the issue.

Sorry, I can’t .

I found the problem.

locations query returns only the locations which support picking up feature.

make sure you check this option in shipping and delivering settings for each location you want.