ChatMessage
One chat bubble in a {@see ChatConversation}.
type ChatMessage {
id: ID!
chat_conversation_id: ID!
parent_message_id: ID
body: String
payload: ChatMessagePayload
ai_agent_run_id: ID
created_at: DateTime!
updated_at: DateTime
author: ChatActor!
replies: [ChatMessage!]!
}
Fields
ChatMessage.id ● ID! non-null scalar
ChatMessage.chat_conversation_id ● ID! non-null scalar
ChatMessage.parent_message_id ● ID scalar
ChatMessage.body ● String scalar
ChatMessage.payload ● ChatMessagePayload union
Discriminated payload — agents emit one of the member shapes per turn.
The kind discriminator on the stored array maps to the GraphQL
__typename via the ChatMessagePayload union resolver. UIs dispatch
renderers off __typename; the typing prevents the JSON-scalar-as-
string drift we had with the earlier payload: JSON schema.
ChatMessage.ai_agent_run_id ● ID scalar
ChatMessage.created_at ● DateTime! non-null scalar
ChatMessage.updated_at ● DateTime scalar
ChatMessage.author ● ChatActor! non-null object
Pre-resolved actor — kind, displayName, avatarUrl, isCurrentUser — so the chat UI never needs a second lookup. AI agents always present as "Paminga IQ" regardless of which agent class actually ran.
ChatMessage.replies ● [ChatMessage!]! non-null object
Returned By
postChatMessage mutation
Member Of
ChatConversation object ● ChatMessage object


