> ## 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.

# Content

> Published content with compiled BindJS

The `Content` type represents published content items with compiled BindJS code ready for rendering.

## Type Definition

```graphql theme={null}
type Content {
  id: ID!
  typeId: ID!
  packageVersion: String!
  name: String!
  description: String!
  content: String!
  compiled: String!
  tags: [String!]!
  locale: String
  createdAt: DateTime!
  updatedAt: DateTime!
  lastPublishedVersion: Int
  cdnUrl: String

  # Relationships
  contentType: ContentType

  # Package resolution
  resolvedPackage: ResolvedPackage
  resolvedRef: ResolvedPackageRef!
}
```

## Fields

| Field | Type | Description |
| - | - | - |
| `id` | ID! | Unique identifier |
| `typeId` | ID! | Content type ID |
| `packageVersion` | String! | Package version for component resolution |
| `name` | String! | Content name |
| `description` | String! | Content description |
| `content` | String! | JSON content structure |
| `compiled` | String! | Standalone BindJS code |
| `tags` | \[String!]! | Content tags for categorization |
| `locale` | String | Content locale (e.g., "en-US") |
| `createdAt` | DateTime! | Creation timestamp |
| `updatedAt` | DateTime! | Last update timestamp |
| `lastPublishedVersion` | Int | Version number of the last published version |
| `cdnUrl` | String | CDN URL for the published content |
| `contentType` | ContentType | Related content type |
| `resolvedPackage` | ResolvedPackage | Full package data with dependencies |
| `resolvedRef` | ResolvedPackageRef! | Package IDs for normalized caching |

## Field Details

### content

The content field contains the JSON structure of the content data:

```json theme={null}
{
  "title": "Getting Started Guide",
  "body": "Welcome to Metabind...",
  "author": "John Doe",
  "publishDate": "2024-01-15T10:00:00Z"
}
```

### compiled

The compiled field contains standalone BindJS code that can be executed directly:

```javascript theme={null}
const body = () => {
  return ArticleLayout({
    title: "Getting Started Guide",
    body: "Welcome to Metabind...",
    author: "John Doe"
  })
}
```

### resolved vs resolvedRef

Choose based on your use case:

* **resolvedPackage**: Full package data inline (simpler client implementation)
* **resolvedRef**: IDs only for normalized caching (smaller payloads, efficient caching)

## Example Queries

### Basic Content

```graphql theme={null}
query GetContent($id: ID!) {
  content(id: $id) {
    id
    name
    description
    tags
    locale
    contentType {
      name
    }
  }
}
```

### Content with Full Package Data

```graphql theme={null}
query GetContentResolved($id: ID!) {
  content(id: $id) {
    id
    name
    compiled
    contentType {
      name
      schema
    }
    resolvedPackage {
      package {
        id
        version
        components
        assets
      }
      dependencies {
        id
        version
        components
        assets
      }
    }
  }
}
```

### Content with Caching References

```graphql theme={null}
query GetContentWithCaching($id: ID!) {
  content(id: $id) {
    id
    name
    compiled
    resolvedRef {
      package
      dependencies
    }
  }
}
```

Response:

```json theme={null}
{
  "data": {
    "content": {
      "id": "cont123",
      "name": "Getting Started",
      "compiled": "const body = () => { ... }",
      "resolvedRef": {
        "package": "abc123def456...",
        "dependencies": ["xyz789ghi012..."]
      }
    }
  }
}
```

## Related Types

* [ContentType](/graphql/types/content-type) - Defines content structure
* [Resolved Package](/graphql/types/resolved-package) - Package resolution types
* [ContentUpdate](/graphql/types/subscription-types) - Real-time content updates


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.