Support multiple aggregation types in gql

This commit is contained in:
2024-03-31 03:49:29 +00:00
parent 01a580cee5
commit ed751f5cdd
4 changed files with 95 additions and 159 deletions

View File

@@ -7,7 +7,7 @@ type Query {
getDeployedConfig: DeployedConfigGQL!
getPlayTime(userId: Int!): UserPlayTimeGQL!
getVideo(videoId: Int!): VideoGQL!
getShots(filterInput: FilterInput = null): [ShotGQL!]!
getShots(filterInput: FilterInput!): [ShotGQL!]!
getBucketSet(keyName: String!): BucketSetGQL
getVideoFeedForUser(limit: Int! = 5, after: String = null): VideoFeedGQL!
getVideoMakePercentageIntervals(
@@ -17,25 +17,30 @@ type Query {
}
type AggregateResultGQL {
featureBuckets: [BucketGQL!]!
targetMetrics: TargetMetricGQL!
aggregationIdentifiers: [AggregationIdentifierGQL!]!
targetMetrics: TargetMetricsGQL!
}
type BucketGQL {
rangeKey: String!
lowerBound: Float!
type AggregationIdentifierGQL {
featureName: String!
groupName: String!
}
type TargetMetricGQL {
count: Int
type TargetMetricsGQL {
count: Int!
makePercentage: Float
}
input AggregateInputGQL {
bucketSets: [BucketSetInputGQL!]!
aggregations: [AggregationInput!]!
filterInput: FilterInput
}
input AggregationInput {
bucketSet: BucketSetInputGQL = null
enum: EnumAggregation = null
}
input BucketSetInputGQL {
feature: String!
buckets: [BucketInputGQL!]!
@@ -46,18 +51,22 @@ input BucketInputGQL {
lowerBound: Float!
}
input EnumAggregation {
feature: String!
}
input FilterInput {
andFilters: AndFilter = null
orFilters: OrFilter = null
cueObjectDistance: CueObjectDistanceInput = null
targetPocketDistance: TargetPocketDistanceInput = null
cueObjectAngle: CueObjectAngleInput = null
cueBallSpeed: CueBallSpeedInput = null
intendedPocketType: IntendedPocketTypeInput = null
shotDirection: ShotDirectionInput = null
cueObjectDistance: RangeFilter = null
targetPocketDistance: RangeFilter = null
cueObjectAngle: RangeFilter = null
cueBallSpeed: RangeFilter = null
intendedPocketType: [PocketEnum!] = null
shotDirection: [ShotDirectionEnum!] = null
videoId: [Int!] = null
userId: [Int!] = null
make: MakeInputGQL = null
make: [Boolean!] = null
tags: [VideoTagInput!] = null
}
@@ -69,45 +78,20 @@ input OrFilter {
filters: [FilterInput!]!
}
input CueObjectDistanceInput {
value: RangeFilter!
}
input RangeFilter {
lessThan: Float = null
greaterThanEqualTo: Float = null
}
input TargetPocketDistanceInput {
value: RangeFilter!
enum PocketEnum {
CORNER
SIDE
}
input CueObjectAngleInput {
value: RangeFilter!
}
input CueBallSpeedInput {
value: RangeFilter!
}
input IntendedPocketTypeInput {
value: ValueFilterString!
}
input ValueFilterString {
equals: String = null
}
input ShotDirectionInput {
value: ValueFilterString!
}
input MakeInputGQL {
value: ValueFilterBool!
}
input ValueFilterBool {
equals: Boolean = null
enum ShotDirectionEnum {
LEFT
RIGHT
STRAIGHT
}
input VideoTagInput {
@@ -169,41 +153,9 @@ type ShotGQL {
endFrame: Int
createdAt: DateTime
updatedAt: DateTime
features: ShotFeaturesGQL
cueObjectFeatures: CueObjectFeaturesGQL
pocketingIntentionFeatures: PocketingIntentionFeaturesGQL
}
type ShotFeaturesGQL {
cueObjectAngle: Float
cueObjectDistance: Float
targetPocketDistance: Float
intendedPocket: PocketEnum
cueBallSpeed: Float
shotDirection: ShotDirectionEnum
bank: BankFeaturesGQL
}
enum PocketEnum {
CORNER
SIDE
}
enum ShotDirectionEnum {
LEFT
RIGHT
STRAIGHT
}
type BankFeaturesGQL {
wallsHit: [WallTypeEnum!]!
bankAngle: Float!
distance: Float!
}
enum WallTypeEnum {
LONG
SHORT
bankFeatures: BankFeaturesGQL
}
type CueObjectFeaturesGQL {
@@ -219,6 +171,17 @@ type PocketingIntentionFeaturesGQL {
intendedPocketType: PocketEnum
}
type BankFeaturesGQL {
wallsHit: [WallTypeEnum!]!
bankAngle: Float!
distance: Float!
}
enum WallTypeEnum {
LONG
SHORT
}
type UploadStreamGQL {
id: ID!
linksRequested: Int!
@@ -278,6 +241,11 @@ type BucketSetGQL {
buckets: [BucketGQL!]!
}
type BucketGQL {
rangeKey: String!
lowerBound: Float!
}
type VideoFeedGQL {
videos: [VideoGQL!]!
pageInfo: PageInfoGQL!