autocompleteAddressFieldOptions
Autocomplete the options of a single SELECT or TEXT field in an address field descriptor. For TEXT fields, the options are suggestions and the chosen option's label is the value to submit. Resolves the descriptor identified by addressFieldDescriptorId, locates the field named fieldName, and returns its options filtered by query (a case-insensitive substring match against each option's label, capped at a fixed result limit). An empty or omitted query returns the first options unfiltered, still subject to the cap, which is handy for previewing the available options before the user has typed anything.
Arguments
Address field descriptor identifier. Typically an ISO 3166-1 alpha-2 country code, but may also be a custom descriptor key.
Machine identifier of the field to autocomplete, e.g. 'administrative_area'.
The user-supplied type-ahead query. An empty string matches every option, subject to the cap.
Returns
[AddressFieldOptionType!]!A single selectable option for a SELECT address field, or a suggestion for an autocompletable TEXT address field.
Examples
query AutocompleteAddressFieldOptions(
$addressFieldDescriptorId: String!,
$fieldName: String!,
$query: String
) {
autocompleteAddressFieldOptions(
addressFieldDescriptorId: $addressFieldDescriptorId,
fieldName: $fieldName,
query: $query
) {
label
value
}
}
Variables
{
"addressFieldDescriptorId": "93455537",
"fieldName": "dream-none-group-city-since",
"query": "trouble-finish-they-get-price"
}
Response
{
"data": {
"autocompleteAddressFieldOptions": [
{
"label": "yet-sign-argue-itself-heavy",
"value": "family-staff-kid-recognize-play"
}
]
}
}