List Saved Searches
Fetch a paginated list of saved searches, optionally filtered by type.
query GetSavedSearches($type: SavedSearchType, $page: Int, $limit: Int) {
savedSearches(type: $type, page: $page, limit: $limit) {
data {
id
name
description
type
}
pagination {
page
limit
total
pages
}
}
}
Parameters
| Parameter | Type | Default | Description |
|---|
type | SavedSearchType | - | Filter by search type (CONTENT or ASSET) |
page | Int | 1 | Page number |
limit | Int | 20 | Items per page |
Example
query {
savedSearches(type: CONTENT, page: 1, limit: 10) {
data {
id
name
description
type
}
pagination {
total
}
}
}
Response:
{
"data": {
"savedSearches": {
"data": [
{
"id": "ss123",
"name": "Recent Tutorials",
"description": "Tutorials updated in the last 30 days",
"type": "CONTENT"
},
{
"id": "ss124",
"name": "Published Articles",
"description": "All published blog articles",
"type": "CONTENT"
}
],
"pagination": {
"total": 2
}
}
}
}
Get Single Saved Search
Fetch a specific saved search by ID.
query GetSavedSearch($id: ID!) {
savedSearch(id: $id) {
id
name
description
type
}
}
Parameters
| Parameter | Type | Required | Description |
|---|
id | ID! | Yes | Saved search ID |
Execute Saved Search
Run a saved search and get paginated results.
query ExecuteSavedSearch($id: ID!, $page: Int, $limit: Int) {
executeSavedSearch(id: $id, page: $page, limit: $limit) {
... on ContentList {
data {
id
name
tags
compiled
}
pagination {
page
limit
total
pages
}
}
... on AssetList {
data {
id
name
type
url
}
pagination {
page
limit
total
pages
}
}
}
}
Parameters
| Parameter | Type | Required | Description |
|---|
id | ID! | Yes | Saved search ID |
page | Int | No | Page number (default: 1) |
limit | Int | No | Items per page (default: 20) |
Example
query {
executeSavedSearch(id: "ss123", page: 1, limit: 10) {
... on ContentList {
data {
id
name
tags
}
pagination {
total
pages
}
}
}
}
Response:
{
"data": {
"executeSavedSearch": {
"data": [
{
"id": "cont456",
"name": "Getting Started Guide",
"tags": ["tutorial", "beginner"]
},
{
"id": "cont457",
"name": "Advanced Patterns",
"tags": ["tutorial", "advanced"]
}
],
"pagination": {
"total": 5,
"pages": 1
}
}
}
}
Saved Search Fields
| Field | Type | Description |
|---|
id | ID! | Unique identifier |
name | String! | Search name |
description | String | Search description |
type | SavedSearchType! | CONTENT or ASSET |
SavedSearchType Enum
| Value | Description |
|---|
CONTENT | Search returns content items |
ASSET | Search returns asset items |
The executeSavedSearch query returns a union type. Use inline fragments (... on ContentList or ... on AssetList) to access the appropriate fields based on the saved search type.