---
title: "ContentTypeQuery"
description: "ContentTypeQuery"
url: "https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/swift/reference/contenttypequery"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-23"
---

# ContentTypeQuery

## ContentTypeQuery

To fetch all or find ContentType use ContentTypeQuery.

## where(queryableCodingKey:_:)

Use this method to do a search on ContentType which enables searching for entries based on value’s for members of referenced entries.

```
let stack = Contentstack.stack(apiKey: "<API_KEY>", deliveryToken: "<DELIVERY_TOKEN>", environment: "<ENVIRNOMENT>")

stack.contentType().query()
.where(queryableCodingKey: .title, .equals("ContentType Title"))
.find { (result: Result<ContentstackResponse<ContentTypeModel>, Error>, response: ResponseType) in
    switch result {
    case .success(let contentstackResponse):
        // Contentstack response with ContentTypeModel array in items.
    case .failure(let error):
        //Error Message
    }
}
```

The member of your QueryableCodingKey that you are performing your select operation against.

The query operation used in the query.

## include(params:)

Include URI parametes to fetch ContentType with Global Fields and Count.

```
let stack = Contentstack.stack(apiKey: "<API_KEY>", deliveryToken: "<DELIVERY_TOKEN>", environment: "<ENVIRNOMENT>")

stack.contentType().query().include(params: [.all])
.find { (result: Result<ContentstackResponse<ContentTypeModel>, Error>, response: ResponseType) in
    switch result {
    case .success(let contentstackResponse):
        // Contentstack response with ContentTypeModel array in items.
    case .failure(let error):
        //Error Message
    }
}
let stack = Contentstack.stack(apiKey: "<API_KEY>", deliveryToken: "<DELIVERY_TOKEN>", environment: "<ENVIRNOMENT>")
stack.contentType().query().include(params: [.count]) 
.find { (result: Result<ContentstackResponse<ContentTypeModel>, Error>, response: ResponseType) in 
  switch result { 
  case .success(let contentstackResponse): 

  case .failure(let error): 
  }
}
```

The member of your ContentTypeQuery.Include that you want to include in response

## includeMetadata()

Includes ContentTypeQuery metadata along with response body

```
let stack = Contentstack.stack(apiKey: apiKey,
 deliveryToken: deliveryToken,
  environment: environment)
  
stack.contentType(uid: contentTypeUID).entry().includeMetadata().query()
```

Set cache policy for the ContentTypeQuery request.

Stack instance for ContentTypeQuery to be fetched

URI Parameters.

Query parameter

## ContentTypeQuery | Swift Delivery SDK | Contentstack

ContentTypeQuery lets you fetch all or find specific content types in the Contentstack Swift Delivery SDK.