categories: Gmail system categories (primary, social, promotions, updates, forums)
label: User-created Gmail labels (case-sensitive, discovered via gmail-labels-list)
rawGmailQuery: Escape hatch for advanced Gmail query syntax
Plus all base fields from baseEmailQueryFields:
Email addresses: from, to, cc, bcc (support string or field operators)
Content: subject, body, text
Flags: hasAttachment, isRead
Date range: date { $gte, $lt }
Logical operators: $and, $or, $not (recursive)
Note: Cast through unknown to work around Zod's lazy schema type inference issue
with exactOptionalPropertyTypes. The runtime schema is correct; this cast ensures
TypeScript sees the strict GmailQuery type everywhere the schema is used.
Gmail-specific query schema with recursive operators and Gmail features.
Includes Gmail-specific features:
Plus all base fields from baseEmailQueryFields:
Note: Cast through unknown to work around Zod's lazy schema type inference issue with exactOptionalPropertyTypes. The runtime schema is correct; this cast ensures TypeScript sees the strict GmailQuery type everywhere the schema is used.