A Query allows us to provide a nested structure of expressions (as Operators) that contain criteria that we can use with the entries.search() method in a Delivery API client. The returned object allows us to add additional refinements to the search before the request for content is made, such as specifying the pageIndex, the ordering of results, or which fields to return.
Call signature
new Query(...whereExpressions: Operators[]): Query
Parameters
Name | Type | Description |
---|---|---|
whereExpressions | Operators[] | An array of search expressions constructed as Operators |
Returns
An instance of Query we can set specific properties and use with entries.search()
Properties
Name | Type | Description |
---|---|---|
orderBy | string | string[] | OrderBy | Sort search results by one or more content fields |
pageIndex | number | The index of subsequent pages of search results (required if > 0) |
pageSize | number | The size of each page of search results |
fieldLinkDepths | { string: number } | Object containing field paths to resolve linked entries for and the link depth to resolve the field to |
fields | string [ ... ] | A list of entry fields that will be retrieved (if the returned entries contain them) |
where | WhereExpression | Read or refine query expressions |