From c2d2a2d2b4c08307ef8a1a57b2cd56c29e05f73f Mon Sep 17 00:00:00 2001 From: Peter Sanchez Date: Tue, 3 Sep 2024 13:59:16 -0600 Subject: [PATCH] Fix admin dashboard query --- admin/routes.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/admin/routes.go b/admin/routes.go index 8435a91..061b47f 100644 --- a/admin/routes.go +++ b/admin/routes.go @@ -219,14 +219,21 @@ func (s *Service) Dashboard(c echo.Context) error { } `json:"getAdminBillingStats"` } var billingStatsResult GraphQLBillingStatsResponse + // XXX Review this in the future. We shouldn't have to set an interval here. + // This broke after a gqlgen update from 0.17.29 to 0.17.49. May be related + // to new omittable field feature. Could also just be our query was wrong all + // along :) op = gqlclient.NewOperation( - `query GetAdminBillingStats() { - getAdminBillingStats(input: {}) { + `query GetAdminBillingStats($interval: Int) { + getAdminBillingStats(input: { + interval: $interval + }) { activeSubscriptions pendingCancelSubscriptions canceledSubscription } }`) + op.Var("interval", links.FilterLast30Days) err = links.Execute(c.Request().Context(), op, &billingStatsResult) if err != nil { return err -- 2.45.2