Storefront GraphQL API get list of available countries and states/provinces

How do I get a list of the countries and their states/provinces with the Storefront GraphQL API?

I am creating a page in React where a customer can edit their address. I want to use the Storefront GraphQL API because that is what all of the other queries in my React site are written with.

I tried this query but it looks like the states/provinces are not available to be retrieved. Why are the states/provinces not available here?

https://shopify.dev/api/storefront/2022-01/objects/Country#fields

{
  localization {
    availableCountries {
      name
    }
  }
}

Hi

did you get any solution to fetch the states/Province

Did you found the solution? I’m stucking on this also.

This might be what you are looking for
https://shopify.dev/docs/api/storefront/2024-01/queries/localization

it’s not working