addressLookup Query
Description
Searches addresses as the user types (server-side Google Places autocomplete). Generate one random sessionToken (e.g. a UUID) when the user starts typing and send it to both addressLookup and addressLookupDetails — the provider then bills the whole session as a single lookup.
query addressLookup(
$term: String!
$sessionToken: String
$language: String
$alpha2: String
) {
addressLookup(
term: $term
sessionToken: $sessionToken
language: $language
alpha2: $alpha2
) {
placeId
description
}
}
Variables
{
"term": "term",
"sessionToken": "sessionToken",
"language": "language",
"alpha2": "alpha2"
}
Response
{
"addressLookup": [
{
"placeId": "b5f50ee75126449d38c9cbc1",
"description": "example"
}
]
}
Arguments
| Name | Type | Description |
|---|---|---|
term | String! | Partial address typed by the user (minimum 3 characters). |
sessionToken | String | Random token grouping the autocomplete session for billing. Reuse the same token for addressLookupDetails. |
language | String | Language code for the returned suggestions (e.g. "en", "de"). |
alpha2 | String | Two-letter country code to restrict suggestions to (e.g. the country selected in the form). |