> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Schema Definition

> GraphQL schema types, enums, and inputs

## Scalar Types

```graphql theme={null}
scalar DateTime  # ISO 8601 formatted date-time string
```

## Enums

### ComponentType

```graphql theme={null}
enum ComponentType {
  VIEW
  LAYOUT
}
```

### SavedSearchType

```graphql theme={null}
enum SavedSearchType {
  CONTENT
  ASSET
}
```

### SortOrder

```graphql theme={null}
enum SortOrder {
  ASC
  DESC
}
```

## Input Types

### Filter Operators

String and array filtering:

```graphql theme={null}
input FilterOperators {
  eq: String      # Equals
  ne: String      # Not equals
  in: [String!]   # In array
  nin: [String!]  # Not in array
  all: [String!]  # Contains all values
  any: [String!]  # Contains any values
  like: String    # Pattern matching (% wildcard)
}
```

Numeric filtering:

```graphql theme={null}
input NumberFilterOperators {
  eq: Float       # Equals
  ne: Float       # Not equals
  gt: Float       # Greater than
  gte: Float      # Greater than or equal
  lt: Float       # Less than
  lte: Float      # Less than or equal
  in: [Float!]    # In array
  nin: [Float!]   # Not in array
}
```

Date filtering:

```graphql theme={null}
input DateFilterOperators {
  eq: DateTime    # Equals
  ne: DateTime    # Not equals
  gt: DateTime    # Greater than (after)
  gte: DateTime   # Greater than or equal
  lt: DateTime    # Less than (before)
  lte: DateTime   # Less than or equal
}
```

### Sort Criteria

```graphql theme={null}
input SortCriteria {
  field: String!
  order: SortOrder!
}
```

### Content Filter

```graphql theme={null}
input ContentFilter {
  name: FilterOperators
  description: FilterOperators
  tags: FilterOperators
  typeId: FilterOperators
  locale: FilterOperators
  createdAt: DateFilterOperators
  updatedAt: DateFilterOperators
}
```

### Asset Filter

```graphql theme={null}
input AssetFilter {
  name: FilterOperators
  type: FilterOperators         # MIME type
  tags: FilterOperators
  size: NumberFilterOperators
  width: NumberFilterOperators  # Images only
  height: NumberFilterOperators # Images only
}
```

## Pagination

All list queries use cursor-based pagination for efficient traversal of large datasets:

```graphql theme={null}
type CursorPagination {
  cursor: String    # Opaque token for next page (null if no more results)
  hasMore: Boolean! # Whether more results exist
  limit: Int!       # Items returned in this page
}
```

### Cursor-Based Pagination

Unlike page-based pagination, cursor-based pagination uses an opaque cursor token to track position:

* **cursor**: Pass this value to the next query to continue pagination. `null` when no more results.
* **hasMore**: `true` if additional results exist beyond the current page.
* **limit**: The number of items requested (and returned, unless fewer remain).

Example usage:

```graphql theme={null}
query GetContent($cursor: String) {
  contents(cursor: $cursor, limit: 20) {
    data {
      id
      name
    }
    pagination {
      cursor
      hasMore
      limit
    }
  }
}
```

## List Types

```graphql theme={null}
type ComponentList {
  data: [Component!]!
  pagination: CursorPagination!
}

type PackageList {
  data: [Package!]!
  pagination: CursorPagination!
}

type ContentList {
  data: [Content!]!
  pagination: CursorPagination!
}

type ContentTypeList {
  data: [ContentType!]!
  pagination: CursorPagination!
}

type AssetList {
  data: [Asset!]!
  pagination: CursorPagination!
}

type TagList {
  data: [Tag!]!
  pagination: CursorPagination!
}

type SavedSearchList {
  data: [SavedSearch!]!
  pagination: CursorPagination!
}
```

## Union Types

### SavedSearchResult

Returned when executing a saved search (type determines which variant):

```graphql theme={null}
union SavedSearchResult = ContentList | AssetList
```

### PreviewResult

Returned from preview queries:

```graphql theme={null}
union PreviewResult = ComponentPreview | ContentPreview
```
