Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

GraphQL locations query

Solved

GraphQL locations query

NatDev
Shopify Partner
7 1 1

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.

Accepted Solution (1)

NatDev
Shopify Partner
7 1 1

This is an accepted solution.

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.

View solution in original post

Replies 9 (9)

oscprofessional
Shopify Partner
16380 2441 3190

Hi @NatDev ,

Please change your query to,

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

Thanks .... 

Hire us | Pass Core Web Vital | B2B Wholesale Experts | Claim Your Free Website Review |
Connect with Us: WhatsApp | Skype: oscprofessionals-87 | Email: pallavi@oscprofessionals.com |
Custom Shopify SolutionsPrivate Apps, Theme Customization & SEO | Digital Marketing |
OSCP Apps: Discount Suite | Wholesale App | Bundle & Upsell | Shipping Discount | and more...
NatDev
Shopify Partner
7 1 1

Hey Oscprofessional,
still the same problem 

 

Screenshot 2023-04-11 094103.png

oscprofessional
Shopify Partner
16380 2441 3190

Hi @NatDev ,

Try this, It is working

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

 

Thanks....

Hire us | Pass Core Web Vital | B2B Wholesale Experts | Claim Your Free Website Review |
Connect with Us: WhatsApp | Skype: oscprofessionals-87 | Email: pallavi@oscprofessionals.com |
Custom Shopify SolutionsPrivate Apps, Theme Customization & SEO | Digital Marketing |
OSCP Apps: Discount Suite | Wholesale App | Bundle & Upsell | Shipping Discount | and more...
NatDev
Shopify Partner
7 1 1

No, it's not working.

locations query keeps returning an empty array.

 

Screenshot 2023-04-11 123624.png

oscprofessional
Shopify Partner
16380 2441 3190

Hi @NatDev ,

Did you assign store name here,

oscprofessional_0-1681202509274.png

If not please update and try again.

Thanks....

Hire us | Pass Core Web Vital | B2B Wholesale Experts | Claim Your Free Website Review |
Connect with Us: WhatsApp | Skype: oscprofessionals-87 | Email: pallavi@oscprofessionals.com |
Custom Shopify SolutionsPrivate Apps, Theme Customization & SEO | Digital Marketing |
OSCP Apps: Discount Suite | Wholesale App | Bundle & Upsell | Shipping Discount | and more...
NatDev
Shopify Partner
7 1 1

Yes, sure I have store name.

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

oscprofessional
Shopify Partner
16380 2441 3190

Hi @NatDev ,

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

Hire us | Pass Core Web Vital | B2B Wholesale Experts | Claim Your Free Website Review |
Connect with Us: WhatsApp | Skype: oscprofessionals-87 | Email: pallavi@oscprofessionals.com |
Custom Shopify SolutionsPrivate Apps, Theme Customization & SEO | Digital Marketing |
OSCP Apps: Discount Suite | Wholesale App | Bundle & Upsell | Shipping Discount | and more...
NatDev
Shopify Partner
7 1 1

Sorry, I can't .

NatDev
Shopify Partner
7 1 1

This is an accepted solution.

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.