Skip to content

Commit 5c8ab13

Browse files
committed
feat: introdce additional country fields
- add field to Country type: region_required - add field to Country type: postcode_required - add field to Country type: name - add field to Country type: eu - deprecate full_name_locale in favor of name - deprecate full_name_english in favor of name - add field to StoreConfig: default_country - add field to StoreConfig: allow_optional_state - adds field docs with sorting information
1 parent 6820530 commit 5c8ab13

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

design-documents/graph-ql/coverage/directory.graphqls

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
type Query {
55
currency: Currency @resolver(class: "Magento\\DirectoryGraphQl\\Model\\Resolver\\Currency") @doc(description: "The currency query returns information about store currency.") @cache(cacheable: false)
6-
countries: [Country] @resolver(class: "Magento\\DirectoryGraphQl\\Model\\Resolver\\Countries") @doc(description: "The countries query provides information for all countries.") @cache(cacheable: false)
6+
countries: [Country] @resolver(class: "Magento\\DirectoryGraphQl\\Model\\Resolver\\Countries") @doc(description: "The countries query provides information for all countries. Sorted by Top Destination and locale specific country name.") @cache(cacheable: false)
77
country (id: String): Country @resolver(class: "Magento\\DirectoryGraphQl\\Model\\Resolver\\Country") @doc(description: "The countries query provides information for a single country.") @cache(cacheable: false)
88
}
99

@@ -25,15 +25,24 @@ type ExchangeRate {
2525

2626
type Country {
2727
id: String
28-
two_letter_abbreviation: String
29-
three_letter_abbreviation: String
30-
full_name_locale: String
31-
full_name_english: String
32-
available_regions: [Region]
28+
two_letter_abbreviation: String @doc(description: "Country code according to ISO 3166-1 alpha-2")
29+
three_letter_abbreviation: String @doc(description: "Country code according to ISO 3166-1 alpha-3")
30+
name: String @doc(description: "Name of the country in the locale of the current store")
31+
full_name_locale: String @deprecated(reason: "Use `name`")
32+
full_name_english: String @deprecated(reason: "Use `name`")
33+
region_required: Boolean @doc(description: "Is a the region for this country")
34+
postcode_required: Boolean @doc(description: "Is a postcode required for this country")
35+
eu: Boolean @doc(description: "Country is a member of the European Union")
36+
available_regions: [Region] @doc(description: "Only returns regions if region_required StoreConfig.allow_optional_state is set. Sorted by localized name.")
3337
}
3438

3539
type Region {
3640
id: Int
37-
code: String
38-
name: String
41+
code: String @doc(description: "Retuns the region code if a region has a code, else returns the non localized name")
42+
name: String @doc(description: "Locale specific region name.")
43+
}
44+
45+
type StoreConfig {
46+
default_country: String @doc(description: "Default country used for country fields")
47+
allow_optional_state: String @doc(description: "Allow a customer to enter a state when it isn't required for a country")
3948
}

0 commit comments

Comments
 (0)