Understanding ContentType vs FileType

User Intent

"What's the difference between contentType and fileType? When do I use each?"

Operation

  • Concept: Content classification hierarchy

  • GraphQL Fields: content.type (ContentType), content.fileType (FileType)

  • Entity Type: Content

  • Common Use Cases: Filtering content, UI display logic, workflow routing, understanding content structure

Key Concept: The Hierarchy

ContentType is PRIMARY - Semantic classification of what the content represents:

  • EMAIL - Email messages

  • MESSAGE - Chat messages (Slack, Teams, Discord)

  • PAGE - Web pages

  • FILE - Files (documents, images, audio, video, code)

  • POST - Social posts (Reddit, RSS)

  • EVENT - Calendar events

  • ISSUE - Issue tracker items (Jira, Linear, GitHub)

  • TEXT - Plain text, markdown, HTML

  • MEMORY - Agent or user memory

FileType is SECONDARY - Physical format (ONLY when contentType = FILE):

  • DOCUMENT - PDF, Word, Excel, PowerPoint

  • IMAGE - JPEG, PNG, GIF, TIFF

  • AUDIO - MP3, WAV, podcast files

  • VIDEO - MP4, MOV, AVI

  • CODE - Source code files

  • DATA - JSON, XML, CSV

  • PACKAGE - ZIP, TAR, archives

  • ANIMATION, DRAWING, GEOMETRY, POINT_CLOUD, SHAPE, etc.

TypeScript (Canonical)

ContentType → Metadata Field Mapping

CRITICAL: Each ContentType has a corresponding metadata field on the content object:

ContentType
Metadata Field
Type
When Set

EMAIL

content.email

EmailMetadata

Always for emails

MESSAGE

content.message

MessageMetadata

Always for messages

EVENT

content.event

EventMetadata

Always for events

ISSUE

content.issue

IssueMetadata

Always for issues

POST

content.post

PostMetadata

Always for posts

FILE (Document)

content.document

DocumentMetadata

When fileType=DOCUMENT

FILE (Image)

content.image

ImageMetadata

When fileType=IMAGE

FILE (Audio)

content.audio

AudioMetadata

When fileType=AUDIO

FILE (Video)

content.video

VideoMetadata

When fileType=VIDEO

FILE (Package)

content.package

PackageMetadata

When fileType=PACKAGE

PAGE

content.html, content.markdown

Strings

Always for pages

Access Pattern:

Developer Hints

FileType Only Exists for Files

Automatic Classification

Query Flexibility

Variations

1. Query All Communication Content

2. Query All Media Files

3. Query Documents Only (No Other Files)

4. Query Calendar Events

5. Query Issues from Project Management Tools

6. UI Display Logic by Type

7. Workflow Routing by Type

Common Issues & Solutions

Issue: Querying for emails by fileType returns no results

Solution: Only use fileType with FILE content

Issue: Metadata field is null even though content exists

Solution: Check content type first

Issue: Want to query "all files" but fileType filter is too specific

Solution: Use contentType=FILE without fileType filter

Issue: TypeScript type errors when accessing metadata

Solution: Use type guards

Production Example

Real-world pattern: Content type routing in UI:

Last updated

Was this helpful?