Expose Ai::UsageEvent to GraphQL AiUsageData
Summary
As part of our effort to bring generalized AI usage data to production-ready state in scope of this issue we need to
Proposal
Expose Ai::UsageEvent model to GraphQL under AiUsageData field. PoC can be found in: !194207 (closed)
Technical requirements
- expose
id, user, event, timestampfields only. Don't exposeextrasfor now. Exposingextrasrequires security review. - inherit access rights from
AiUsageDatafield. - suggested structure
- The endpoint should be PG-only for now
aiUsageData {
all(possible_filters) {
nodes {
id event timestamp user { username }
}
}
}
- automatically pickup new event types, inherit event type enum from
Ai::UsageEvent.events - Hide new endpoint behind
unified_ai_events_graphqlderisk feature flag.
Edited by Robert Hunt