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.
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:
edges and node syntaxResolution:
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.
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 …
Hi @NatDev ,
Try this, It is working
{
locations(first: 100) {
edges {
node {
name
}
}
}
collections(first: 10){
edges{
node{
id
}
}
}
}
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.