From 40c4b82a597b153120cee423cfbfa9d1dbbe9ab6 Mon Sep 17 00:00:00 2001 From: Dean Wenstrand Date: Sat, 11 Jul 2026 17:40:10 -0700 Subject: [PATCH] Add weekly cohort funnel to getUsageStats Co-Authored-By: Claude Fable 5 --- src/index.tsx | 22 ++++++++++++++++++++++ src/operations/usage_stats.gql | 6 ++++++ src/schema.gql | 8 ++++++++ 3 files changed, 36 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index cac063d..399f003 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -260,6 +260,14 @@ export type ClusterAssignmentInput = { userId?: InputMaybe; }; +export type CohortStatsGql = { + __typename?: "CohortStatsGQL"; + activated7d: Scalars["Int"]["output"]; + paid7d: Scalars["Int"]["output"]; + signups: Scalars["Int"]["output"]; + weekStart: Scalars["Date"]["output"]; +}; + export type CommentGql = { __typename?: "CommentGQL"; id: Scalars["Int"]["output"]; @@ -3980,6 +3988,7 @@ export type UsageStatsDailyGql = { export type UsageStatsGql = { __typename?: "UsageStatsGQL"; + cohorts: Array; daily: Array; funnel: FunnelStatsGql; processingLast24h: Array; @@ -7475,6 +7484,13 @@ export type GetUsageStatsQuery = { retentionPrevActive: number; retentionReturned: number; }; + cohorts: Array<{ + __typename?: "CohortStatsGQL"; + weekStart: any; + signups: number; + activated7d: number; + paid7d: number; + }>; windows: Array<{ __typename?: "UsageStatsWindowGQL"; label: string; @@ -15788,6 +15804,12 @@ export const GetUsageStatsDocument = gql` retentionPrevActive retentionReturned } + cohorts { + weekStart + signups + activated7d + paid7d + } totalUsers totalVideos totalShots diff --git a/src/operations/usage_stats.gql b/src/operations/usage_stats.gql index 8d6960d..1aaf5ae 100644 --- a/src/operations/usage_stats.gql +++ b/src/operations/usage_stats.gql @@ -12,6 +12,12 @@ query getUsageStats($days: Int! = 30) { retentionPrevActive retentionReturned } + cohorts { + weekStart + signups + activated7d + paid7d + } totalUsers totalVideos totalShots diff --git a/src/schema.gql b/src/schema.gql index 5c0b37f..6979142 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -1175,6 +1175,7 @@ type UsageStatsGQL { totalVideos: Int! totalShots: Int! totalRuns: Int! + cohorts: [CohortStatsGQL!]! windows: [UsageStatsWindowGQL!]! daily: [UsageStatsDailyGQL!]! processingLast24h: [ProcessingStatusCountGQL!]! @@ -1193,6 +1194,13 @@ type FunnelStatsGQL { retentionReturned: Int! } +type CohortStatsGQL { + weekStart: Date! + signups: Int! + activated7d: Int! + paid7d: Int! +} + type UsageStatsWindowGQL { label: String! newUsers: Int!