From ec2e3da513a65b93339853d095fa5c0edec18983 Mon Sep 17 00:00:00 2001 From: Mike Kalange Date: Wed, 18 Sep 2024 13:48:52 -0700 Subject: [PATCH] Add DatetimeRangeAggregation --- src/index.tsx | 28 ++++++++++++++++++++++++++-- src/schema.gql | 38 +++++++++++++++++++++++++++++++++----- 2 files changed, 59 insertions(+), 7 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index c14dd86..bbc1f76 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -62,8 +62,13 @@ export type AggregationIdentifierGql = { }; export type AggregationInput = - | { bucketSet: BucketSetInputGql; enum?: never } - | { bucketSet?: never; enum: EnumAggregation }; + | { bucketSet: BucketSetInputGql; datetimeRange?: never; enum?: never } + | { + bucketSet?: never; + datetimeRange: DatetimeRangeAggregationInput; + enum?: never; + } + | { bucketSet?: never; datetimeRange?: never; enum: EnumAggregation }; export type BankFeaturesGql = { __typename?: "BankFeaturesGQL"; @@ -127,6 +132,12 @@ export type CueObjectFeaturesGql = { spinType?: Maybe; }; +export type DatetimeRangeAggregationInput = { + endDatetime: Scalars["DateTime"]["input"]; + interval: TimeInterval; + startDatetime: Scalars["DateTime"]["input"]; +}; + export type DeployedConfigGql = { __typename?: "DeployedConfigGQL"; allowNewUsers: Scalars["Boolean"]["output"]; @@ -1519,6 +1530,19 @@ export type TargetMetricsGql = { makePercentage?: Maybe; }; +export type TimeInterval = { + days?: InputMaybe; + hours?: InputMaybe; + minutes?: InputMaybe; + /** Assumes a month is 30 days long */ + months?: InputMaybe; + /** A second is the base unit and cannot be subdivided */ + seconds?: InputMaybe; + weeks?: InputMaybe; + /** Assumes a year is 365 days long */ + years?: InputMaybe; +}; + export type TooManyInitUploadsErr = { __typename?: "TooManyInitUploadsErr"; linksRequested: Scalars["Int"]["output"]; diff --git a/src/schema.gql b/src/schema.gql index 1feb613..a107379 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -63,6 +63,7 @@ input AggregateInputGQL { input AggregationInput @oneOf { bucketSet: BucketSetInputGQL enum: EnumAggregation + datetimeRange: DatetimeRangeAggregationInput } input BucketSetInputGQL { @@ -79,6 +80,38 @@ input EnumAggregation { feature: String! } +input DatetimeRangeAggregationInput { + startDatetime: DateTime! + endDatetime: DateTime! + interval: TimeInterval! +} + +""" +Date with time (isoformat) +""" +scalar DateTime + +input TimeInterval { + """ + A second is the base unit and cannot be subdivided + """ + seconds: Int = 0 + minutes: Int = 0 + hours: Int = 0 + days: Int = 0 + weeks: Int = 0 + + """ + Assumes a month is 30 days long + """ + months: Int = 0 + + """ + Assumes a year is 365 days long + """ + years: Int = 0 +} + input FilterInput @oneOf { andFilters: [FilterInput!] orFilters: [FilterInput!] @@ -198,11 +231,6 @@ type ShotGQL { video: VideoGQL } -""" -Date with time (isoformat) -""" -scalar DateTime - type CueObjectFeaturesGQL { cueObjectDistance: Float cueObjectAngle: Float