Resource: Query
The Query resource is a powerful resource to get content based on it's content.
Example
ts
const { data: page } = useUheadless('url', {
query: {
contentTypeAlias: 'employees',
},
domain: 'example.com',
depth: 3,
});
Options
This resource has these properties
Property | Default | Type | Description |
---|---|---|---|
breadcrumb | false | boolean | Include the breadcrumb property in the document result. |
depth | 2 | number | The depth of relations to include in the response. |
domain | string | Scope the results to a specified hostname define under "Culture and hostnames" in Umbraco. | |
exclude | Array<string> | Define the fields that you want to exclude in the response. You can't use both exclude and include. If so, include will take precedence over exclude. | |
filter | uheadlessQuery | Acts like the query but applies the queries as "or" instead of "and". | |
include | Array<string> | Define the fields that you want to include in the response. | |
limit | 10 | number | The amount of document to return form the query. |
locale | current or default language | string | Set the locale of the content you wan't to query for. By default it uses the currentPage if middleware is enabled. Otherwise the language defined as default in Umbraco. |
page | number | The page to load (Only eligable if pagination is true ). | |
pagination | boolean | Enable paginated results in the response. | |
query | uHeadlessQuery | Query the results. See queries sections to learn more. | |
skip | number | The amount to skip before starting the paginated result. | |
sort | asc or desc | The direction you want to sort in. | |
sortBy | string | The property that you want to sort by, e.g. createdAt or propterties.publishDate . |