Skip to content

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

PropertyDefaultTypeDescription
breadcrumbfalsebooleanInclude the breadcrumb property in the document result.
depth2numberThe depth of relations to include in the response.
domainstringScope the results to a specified hostname define under "Culture and hostnames" in Umbraco.
excludeArray<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.
filteruheadlessQueryActs like the query but applies the queries as "or" instead of "and".
includeArray<string>Define the fields that you want to include in the response.
limit10numberThe amount of document to return form the query.
localecurrent or default languagestringSet 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.
pagenumberThe page to load (Only eligable if pagination is true).
paginationbooleanEnable paginated results in the response.
queryuHeadlessQueryQuery the results. See queries sections to learn more.
skipnumberThe amount to skip before starting the paginated result.
sortasc or descThe direction you want to sort in.
sortBystringThe property that you want to sort by, e.g. createdAt or propterties.publishDate.