Skip to content

addressSuggest

Queryin Address suggest

Addresses matching what the buyer has typed so far, for a search box that suggests as they type. Resolve the chosen one with addressResolve.

Pass the same session from the first keystroke to the resolve, for a source that bills a search as one session; one that does not, ignores it. An empty list means nothing matches. Null means the source does not cover the country, or it is unavailable.

Arguments

ArgumentTypeDescription
countryCountryCode!
queryString!
sessionString

Returns

[AddressSuggestion!]

FieldTypeDescription
idID!Opaque; pass it to addressResolve
labelString!The address as the buyer reads it in a list
cityString
countryCountryCode
streetNumberString
streetNumberSuffixString
postalCodeString
streetNameString

Example

query AddressSuggest($country: CountryCode!, $query: String!, $session: String) {
addressSuggest(country: $country, query: $query, session: $session) {
id
label
city
country
streetNumber
streetNumberSuffix
postalCode
streetName
}
}

The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.

Used by

The storefront packages that send it, in these GraphQL documents: