~netlandish/links

d536114e0dccff1d0d35803885273836aaba4597 — Peter Sanchez a month ago 6e97085
Fixing empty query to getAdminBillingStats
1 files changed, 2 insertions(+), 9 deletions(-)

M admin/routes.go
M admin/routes.go => admin/routes.go +2 -9
@@ 219,21 219,14 @@ 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($interval: Int) {
			getAdminBillingStats(input: {
				interval: $interval
			}) {
		`query GetAdminBillingStats {
			getAdminBillingStats {
				activeSubscriptions
				pendingCancelSubscriptions
				canceledSubscription
			}
		}`)
	op.Var("interval", links.FilterLast30Days)
	err = links.Execute(c.Request().Context(), op, &billingStatsResult)
	if err != nil {
		return err