From 4fb084bbc8bd233dcba9d4013ff29e2888eaaff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Semp=C3=A9?= Date: Tue, 10 Sep 2024 16:29:45 +0200 Subject: [PATCH] misc: Remove months restriction from gross revenues --- .../resolvers/analytics/gross_revenues_resolver.rb | 3 ++- schema.graphql | 2 +- schema.json | 12 ++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/graphql/resolvers/analytics/gross_revenues_resolver.rb b/app/graphql/resolvers/analytics/gross_revenues_resolver.rb index ccca61cba37..41baa3e5c4b 100644 --- a/app/graphql/resolvers/analytics/gross_revenues_resolver.rb +++ b/app/graphql/resolvers/analytics/gross_revenues_resolver.rb @@ -12,13 +12,14 @@ class GrossRevenuesResolver < Resolvers::BaseResolver argument :currency, Types::CurrencyEnum, required: false argument :external_customer_id, String, required: false + argument :months, Integer, required: false argument :expire_cache, Boolean, required: false type Types::Analytics::GrossRevenues::Object.collection_type, null: false def resolve(**args) - ::Analytics::GrossRevenue.find_all_by(current_organization.id, **args.merge(months: 12)) + ::Analytics::GrossRevenue.find_all_by(current_organization.id, **args) end end end diff --git a/schema.graphql b/schema.graphql index bc2dac36a82..e67bef3b927 100644 --- a/schema.graphql +++ b/schema.graphql @@ -5933,7 +5933,7 @@ type Query { """ Query gross revenue of an organization """ - grossRevenues(currency: CurrencyEnum, expireCache: Boolean, externalCustomerId: String): GrossRevenueCollection! + grossRevenues(currency: CurrencyEnum, expireCache: Boolean, externalCustomerId: String, months: Int): GrossRevenueCollection! """ Query a single integration diff --git a/schema.json b/schema.json index c569a905981..b6610dee71e 100644 --- a/schema.json +++ b/schema.json @@ -29537,6 +29537,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "months", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "expireCache", "description": null,