diff --git a/src/index.tsx b/src/index.tsx index 885aa8e..48f0be4 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -33,14 +33,25 @@ export type Scalars = { }; export type AggregateInputGql = { - bucketSets: Array; + aggregations: Array; filterInput?: InputMaybe; }; export type AggregateResultGql = { __typename?: "AggregateResultGQL"; - featureBuckets: Array; - targetMetrics: TargetMetricGql; + aggregationIdentifiers: Array; + targetMetrics: TargetMetricsGql; +}; + +export type AggregationIdentifierGql = { + __typename?: "AggregationIdentifierGQL"; + featureName: Scalars["String"]["output"]; + groupName: Scalars["String"]["output"]; +}; + +export type AggregationInput = { + bucketSet?: InputMaybe; + enum?: InputMaybe; }; export type AndFilter = { @@ -96,18 +107,6 @@ export type CreateUploadStreamReturn = { videoId: Scalars["Int"]["output"]; }; -export type CueBallSpeedInput = { - value: RangeFilter; -}; - -export type CueObjectAngleInput = { - value: RangeFilter; -}; - -export type CueObjectDistanceInput = { - value: RangeFilter; -}; - export type CueObjectFeaturesGql = { __typename?: "CueObjectFeaturesGQL"; cueBallSpeed?: Maybe; @@ -127,17 +126,21 @@ export enum DeviceTypeEnum { Ios = "IOS", } +export type EnumAggregation = { + feature: Scalars["String"]["input"]; +}; + export type FilterInput = { andFilters?: InputMaybe; - cueBallSpeed?: InputMaybe; - cueObjectAngle?: InputMaybe; - cueObjectDistance?: InputMaybe; - intendedPocketType?: InputMaybe; - make?: InputMaybe; + cueBallSpeed?: InputMaybe; + cueObjectAngle?: InputMaybe; + cueObjectDistance?: InputMaybe; + intendedPocketType?: InputMaybe>; + make?: InputMaybe>; orFilters?: InputMaybe; - shotDirection?: InputMaybe; + shotDirection?: InputMaybe>; tags?: InputMaybe>; - targetPocketDistance?: InputMaybe; + targetPocketDistance?: InputMaybe; userId?: InputMaybe>; videoId?: InputMaybe>; }; @@ -169,14 +172,6 @@ export type IntPoint2D = { y: Scalars["Int"]["output"]; }; -export type IntendedPocketTypeInput = { - value: ValueFilterString; -}; - -export type MakeInputGql = { - value: ValueFilterBool; -}; - export type MakePercentageIntervalGql = { __typename?: "MakePercentageIntervalGQL"; elapsedTime: Scalars["Float"]["output"]; @@ -283,7 +278,7 @@ export type QueryGetPlayTimeArgs = { }; export type QueryGetShotsArgs = { - filterInput?: InputMaybe; + filterInput: FilterInput; }; export type QueryGetUserArgs = { @@ -315,27 +310,12 @@ export enum ShotDirectionEnum { Straight = "STRAIGHT", } -export type ShotDirectionInput = { - value: ValueFilterString; -}; - -export type ShotFeaturesGql = { - __typename?: "ShotFeaturesGQL"; - bank?: Maybe; - cueBallSpeed?: Maybe; - cueObjectAngle?: Maybe; - cueObjectDistance?: Maybe; - intendedPocket?: Maybe; - shotDirection?: Maybe; - targetPocketDistance?: Maybe; -}; - export type ShotGql = { __typename?: "ShotGQL"; + bankFeatures?: Maybe; createdAt?: Maybe; cueObjectFeatures?: Maybe; endFrame?: Maybe; - features?: Maybe; id?: Maybe; pocketingIntentionFeatures?: Maybe; startFrame?: Maybe; @@ -348,16 +328,12 @@ export type StreamErrorGql = { message: Scalars["String"]["output"]; }; -export type TargetMetricGql = { - __typename?: "TargetMetricGQL"; - count?: Maybe; +export type TargetMetricsGql = { + __typename?: "TargetMetricsGQL"; + count: Scalars["Int"]["output"]; makePercentage?: Maybe; }; -export type TargetPocketDistanceInput = { - value: RangeFilter; -}; - export type UploadStreamGql = { __typename?: "UploadStreamGQL"; createdAt: Scalars["DateTime"]["output"]; @@ -397,14 +373,6 @@ export type UserPlayTimeGql = { totalSeconds: Scalars["Float"]["output"]; }; -export type ValueFilterBool = { - equals?: InputMaybe; -}; - -export type ValueFilterString = { - equals?: InputMaybe; -}; - export type VideoFeedGql = { __typename?: "VideoFeedGQL"; pageInfo: PageInfoGql; @@ -476,14 +444,14 @@ export type GetAggregatedShotMetricsQuery = { __typename?: "Query"; getAggregatedShotMetrics: Array<{ __typename?: "AggregateResultGQL"; - featureBuckets: Array<{ - __typename?: "BucketGQL"; - rangeKey: string; - lowerBound: number; + aggregationIdentifiers: Array<{ + __typename?: "AggregationIdentifierGQL"; + featureName: string; + groupName: string; }>; targetMetrics: { - __typename?: "TargetMetricGQL"; - count?: number | null; + __typename?: "TargetMetricsGQL"; + count: number; makePercentage?: number | null; }; }>; @@ -570,7 +538,7 @@ export type GetVideoMakePercentageIntervalsQuery = { }; export type GetShotsQueryVariables = Exact<{ - filterInput?: InputMaybe; + filterInput: FilterInput; includeCueObjectDistance?: Scalars["Boolean"]["input"]; includeCueObjectAngle?: Scalars["Boolean"]["input"]; includeCueBallSpeed?: Scalars["Boolean"]["input"]; @@ -784,9 +752,9 @@ export type EditUploadStreamMutation = { export const GetAggregatedShotMetricsDocument = gql` query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) { getAggregatedShotMetrics(aggregateInput: $aggregateInput) { - featureBuckets { - rangeKey - lowerBound + aggregationIdentifiers { + featureName + groupName } targetMetrics { count @@ -1125,7 +1093,7 @@ export type GetVideoMakePercentageIntervalsQueryResult = Apollo.QueryResult< >; export const GetShotsDocument = gql` query GetShots( - $filterInput: FilterInput + $filterInput: FilterInput! $includeCueObjectDistance: Boolean! = false $includeCueObjectAngle: Boolean! = false $includeCueBallSpeed: Boolean! = false @@ -1180,7 +1148,7 @@ export const GetShotsDocument = gql` * }); */ export function useGetShotsQuery( - baseOptions?: Apollo.QueryHookOptions, + baseOptions: Apollo.QueryHookOptions, ) { const options = { ...defaultOptions, ...baseOptions }; return Apollo.useQuery( diff --git a/src/operations/aggregate.gql b/src/operations/aggregate.gql index 2069efb..31514d4 100644 --- a/src/operations/aggregate.gql +++ b/src/operations/aggregate.gql @@ -1,8 +1,8 @@ query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) { getAggregatedShotMetrics(aggregateInput: $aggregateInput) { - featureBuckets { - rangeKey - lowerBound + aggregationIdentifiers { + featureName + groupName } targetMetrics { count diff --git a/src/operations/shots.gql b/src/operations/shots.gql index 8113685..1fb634a 100644 --- a/src/operations/shots.gql +++ b/src/operations/shots.gql @@ -1,5 +1,5 @@ query GetShots( - $filterInput: FilterInput + $filterInput: FilterInput! $includeCueObjectDistance: Boolean! = false $includeCueObjectAngle: Boolean! = false $includeCueBallSpeed: Boolean! = false diff --git a/src/schema.gql b/src/schema.gql index 533d04f..8041a95 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -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!