How To Get Regions / State of Country By Using GraphQL

The following below Magento Open Source / Adobe Commerce 2.x GraphQL Query to get Regions / State of Country

Syntax::

{country(id: String) {Country}}

The following below two-letter abbreviation for the country ID (id: “US”), which returns all regions information about USA.

query {
    country(id: "US") {
        id
        two_letter_abbreviation
        three_letter_abbreviation
        full_name_locale
        full_name_english
        available_regions {
            id
            code
            name
        }
    }
}

The following below two-letter abbreviation for the country ID (id: “IN”), which returns all regions information about India.

query {
    country(id: "IN") {
        id
        two_letter_abbreviation
        three_letter_abbreviation
        full_name_locale
        full_name_english
        available_regions {
            id
            code
            name
        }
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *