- Docs
- API reference
- Endpoints and schemas
- GraphQL
- Condition
Conditions
The three condition inputs: on the search, on every connection, and on a saved list.
Condition. These inputs are conditions. They set the exact rules that each record must meet, and the order and size of the list you get back.
Conditions
Section titled “Conditions”You pass it to SearchInput.conditions.
| Field | Type | Part | Description |
|---|---|---|---|
filter |
JSON |
Condition | A filter expression in JSON, such as {EQ: ["addresses.state", "NY"]}. Each object has one operator key that maps to a list of operands, and field names are dot paths. The operators are EQ, NE, GT, GTE, LT, LTE, IN, LIKE, ILIKE, CONTAINS, HAS, IS_NULL, IS_NOT_NULL, AND, OR, NOT, ADD, SUB, MUL, DIV, and NEG. |
orderBy |
[String] |
Condition | A list of sort expressions. Each one is a field path and a direction, ASC or DESC, as in name DESC. Math fields and searches with output reject orderBy. |
limit |
Int |
Condition | The maximum number of results to return. |
pageToken |
String |
Condition | A page number, as a string of digits. The search skips pageToken times limit results. Searches with output reject pageToken, and searches that match on field groups ignore it. |
ConnectionConditions
Section titled “ConnectionConditions”You pass it to SearchListsInput.conditions.
| Field | Type | Part | Description |
|---|---|---|---|
filter |
JSON |
Condition | A filter expression in JSON that selects the edges to return. It takes the same operators as the filter of Conditions, and its field names are dot paths from the node type of the connection. |
orderBy |
[String] |
Condition | A list of sort expressions for the edges. Each one is a field path and a direction, ASC or DESC, as in name DESC. |
ListConditionsInput
Section titled “ListConditionsInput”You pass it to ListSearchInputInput.conditions.
| Field | Type | Part | Description |
|---|---|---|---|
filter |
JSON |
Condition | A filter expression that selects the records of the list. It uses the same syntax as the filter of a search. |
orderBy |
[String] |
Condition | The fields that set the sort order of the records. |
limit |
Int |
Condition | The maximum number of records that the search returns. |
Example
Section titled “Example”query { search(searchInput: { entityType: BRAND name: "Safeway" conditions: { limit: 1 } }) { ... on Brand { id operatingLocations(first: 2, conditions: { filter: { EQ: ["addresses.state", "TX"] } orderBy: ["addresses.city ASC"] }) { edges { node { addresses(first: 1) { edges { node { city state } } } } } } } }}Response, as returned:
{ "data": { "search": [ { "id": "0f26fbef-3436-4f85-8bcd-31fe12a4f99a", "operatingLocations": { "edges": [ { "node": { "addresses": { "edges": [ { "node": { "city": "CEDAR PARK", "state": "TX" } } ] } } }, { "node": { "addresses": { "edges": [ { "node": { "city": "GAINESVILLE", "state": "TX" } } ] } } } ] } } ] } …}