searchSuggest
Requires a customer (portal or buyer app) session.
Returns typeahead suggestions.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query SearchSuggest($q: String!) {
searchSuggest(q: $q) {
query
suggestions {
id
href
imageUrl
kind
label
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query SearchSuggest($q: String!) {\n searchSuggest(q: $q) {\n query\n suggestions {\n id\n href\n imageUrl\n kind\n label\n }\n }\n}",
"variables": {
"q": "string"
}
}
EOF
Variables:
{
"q": "string"
}
Response:
{
"data": {
"searchSuggest": {
"query": "string",
"suggestions": [
{
"id": "id",
"href": "string",
"imageUrl": "string",
"kind": "BRAND",
"label": "string"
}
]
}
}
}
searchSuggest(
addressId: ID
q: String!
): SearchSuggestResponse!
Arguments
searchSuggest.addressId ● ID scalar
The delivery address that decides what is in stock.
searchSuggest.q ● String! non-null scalar
The text the shopper typed.
Type
SearchSuggestResponse object
Search suggestions for a query.