Skip to main content
The SavedSearch type represents stored search configurations that can be executed to retrieve content or assets.

Type Definition

type SavedSearch {
  id: ID!
  name: String!
  description: String
  type: SavedSearchType!
}

Fields

FieldTypeDescription
idID!Unique identifier
nameString!Search name
descriptionStringOptional description
typeSavedSearchType!Search type (CONTENT or ASSET)

SavedSearchType Enum

enum SavedSearchType {
  CONTENT
  ASSET
}
ValueDescription
CONTENTSearch returns content items
ASSETSearch returns asset items

Example Queries

List Saved Searches

query GetSavedSearches($type: SavedSearchType) {
  savedSearches(type: $type, page: 1, limit: 20) {
    data {
      id
      name
      description
      type
    }
    pagination {
      total
    }
  }
}
query GetSavedSearch($id: ID!) {
  savedSearch(id: $id) {
    id
    name
    description
    type
  }
}
Response:
{
  "data": {
    "savedSearch": {
      "id": "ss123",
      "name": "Recent Tutorials",
      "description": "Tutorials updated in the last 30 days",
      "type": "CONTENT"
    }
  }
}
query ExecuteSavedSearch($id: ID!) {
  executeSavedSearch(id: $id, page: 1, limit: 20) {
    ... on ContentList {
      data {
        id
        name
        tags
      }
      pagination {
        total
      }
    }
    ... on AssetList {
      data {
        id
        name
        url
      }
      pagination {
        total
      }
    }
  }
}

SavedSearchResult Union

The executeSavedSearch query returns a union type:
union SavedSearchResult = ContentList | AssetList
Use inline fragments to handle each result type:
... on ContentList {
  data { id name }
}
... on AssetList {
  data { id url }
}
  • Content - Content items returned by CONTENT searches
  • Asset - Assets returned by ASSET searches