Add shots and bucketed shot gql #2

Merged
colonelpanic merged 1 commits from update-agg-gql into master 2024-02-05 19:56:08 -07:00
3 changed files with 183 additions and 0 deletions
Showing only changes of commit 838304efdd - Show all commits

View File

@ -355,6 +355,27 @@ export enum WallTypeEnum {
Short = 'SHORT'
}
export type GetAggregateShotsQueryVariables = Exact<{
bucketSets: Array<BucketSetInputGql> | BucketSetInputGql;
}>;
export type GetAggregateShotsQuery = { __typename?: 'Query', getAggregateShots: Array<{ __typename?: 'AggregateResultGQL', featureBuckets: Array<{ __typename?: 'BucketGQL', rangeKey: string, lowerBound: number }>, targetMetrics: Array<{ __typename?: 'TargetMetricGQL', count?: number | null, makePercentage?: number | null, floatFeature?: { __typename?: 'TargetFloatFeatureGQL', featureName: string, average?: number | null, median?: number | null } | null }> }> };
export type GetShotsQueryVariables = Exact<{
filterInput?: InputMaybe<FilterInput>;
includeCueObjectDistance?: Scalars['Boolean']['input'];
includeCueObjectAngle?: Scalars['Boolean']['input'];
includeCueBallSpeed?: Scalars['Boolean']['input'];
includeShotDirection?: Scalars['Boolean']['input'];
includeTargetPocketDistance?: Scalars['Boolean']['input'];
includeMake?: Scalars['Boolean']['input'];
includeIntendedPocketType?: Scalars['Boolean']['input'];
}>;
export type GetShotsQuery = { __typename?: 'Query', getShots: Array<{ __typename?: 'ShotGQL', id?: number | null, videoId?: number | null, startFrame?: number | null, endFrame?: number | null, createdAt?: any | null, updatedAt?: any | null, cueObjectFeatures?: { __typename?: 'CueObjectFeaturesGQL', cueObjectDistance?: number | null, cueObjectAngle?: number | null, cueBallSpeed?: number | null, shotDirection?: ShotDirectionEnum | null } | null, pocketingIntentionFeatures?: { __typename?: 'PocketingIntentionFeaturesGQL', targetPocketDistance?: number | null, make?: boolean | null, intendedPocketType?: PocketEnum | null } | null }> };
export type CreateUploadStreamMutationVariables = Exact<{
videoName: Scalars['String']['input'];
deviceType?: InputMaybe<DeviceTypeEnum>;
@ -387,6 +408,121 @@ export type TerminateUploadStreamMutationVariables = Exact<{
export type TerminateUploadStreamMutation = { __typename?: 'Mutation', terminateUploadStream: boolean };
export const GetAggregateShotsDocument = gql`
query GetAggregateShots($bucketSets: [BucketSetInputGQL!]!) {
getAggregateShots(bucketSets: $bucketSets) {
featureBuckets {
rangeKey
lowerBound
}
targetMetrics {
count
makePercentage
floatFeature {
featureName
average
median
}
}
}
}
`;
/**
* __useGetAggregateShotsQuery__
*
* To run a query within a React component, call `useGetAggregateShotsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetAggregateShotsQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetAggregateShotsQuery({
* variables: {
* bucketSets: // value for 'bucketSets'
* },
* });
*/
export function useGetAggregateShotsQuery(baseOptions: Apollo.QueryHookOptions<GetAggregateShotsQuery, GetAggregateShotsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetAggregateShotsQuery, GetAggregateShotsQueryVariables>(GetAggregateShotsDocument, options);
}
export function useGetAggregateShotsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetAggregateShotsQuery, GetAggregateShotsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetAggregateShotsQuery, GetAggregateShotsQueryVariables>(GetAggregateShotsDocument, options);
}
export function useGetAggregateShotsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions<GetAggregateShotsQuery, GetAggregateShotsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useSuspenseQuery<GetAggregateShotsQuery, GetAggregateShotsQueryVariables>(GetAggregateShotsDocument, options);
}
export type GetAggregateShotsQueryHookResult = ReturnType<typeof useGetAggregateShotsQuery>;
export type GetAggregateShotsLazyQueryHookResult = ReturnType<typeof useGetAggregateShotsLazyQuery>;
export type GetAggregateShotsSuspenseQueryHookResult = ReturnType<typeof useGetAggregateShotsSuspenseQuery>;
export type GetAggregateShotsQueryResult = Apollo.QueryResult<GetAggregateShotsQuery, GetAggregateShotsQueryVariables>;
export const GetShotsDocument = gql`
query GetShots($filterInput: FilterInput, $includeCueObjectDistance: Boolean! = false, $includeCueObjectAngle: Boolean! = false, $includeCueBallSpeed: Boolean! = false, $includeShotDirection: Boolean! = false, $includeTargetPocketDistance: Boolean! = false, $includeMake: Boolean! = false, $includeIntendedPocketType: Boolean! = false) {
getShots(filterInput: $filterInput) {
id
videoId
startFrame
endFrame
createdAt
updatedAt
cueObjectFeatures {
cueObjectDistance @include(if: $includeCueObjectDistance)
cueObjectAngle @include(if: $includeCueObjectAngle)
cueBallSpeed @include(if: $includeCueBallSpeed)
shotDirection @include(if: $includeShotDirection)
}
pocketingIntentionFeatures {
targetPocketDistance @include(if: $includeTargetPocketDistance)
make @include(if: $includeMake)
intendedPocketType @include(if: $includeIntendedPocketType)
}
}
}
`;
/**
* __useGetShotsQuery__
*
* To run a query within a React component, call `useGetShotsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetShotsQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetShotsQuery({
* variables: {
* filterInput: // value for 'filterInput'
* includeCueObjectDistance: // value for 'includeCueObjectDistance'
* includeCueObjectAngle: // value for 'includeCueObjectAngle'
* includeCueBallSpeed: // value for 'includeCueBallSpeed'
* includeShotDirection: // value for 'includeShotDirection'
* includeTargetPocketDistance: // value for 'includeTargetPocketDistance'
* includeMake: // value for 'includeMake'
* includeIntendedPocketType: // value for 'includeIntendedPocketType'
* },
* });
*/
export function useGetShotsQuery(baseOptions?: Apollo.QueryHookOptions<GetShotsQuery, GetShotsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetShotsQuery, GetShotsQueryVariables>(GetShotsDocument, options);
}
export function useGetShotsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetShotsQuery, GetShotsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetShotsQuery, GetShotsQueryVariables>(GetShotsDocument, options);
}
export function useGetShotsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions<GetShotsQuery, GetShotsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useSuspenseQuery<GetShotsQuery, GetShotsQueryVariables>(GetShotsDocument, options);
}
export type GetShotsQueryHookResult = ReturnType<typeof useGetShotsQuery>;
export type GetShotsLazyQueryHookResult = ReturnType<typeof useGetShotsLazyQuery>;
export type GetShotsSuspenseQueryHookResult = ReturnType<typeof useGetShotsSuspenseQuery>;
export type GetShotsQueryResult = Apollo.QueryResult<GetShotsQuery, GetShotsQueryVariables>;
export const CreateUploadStreamDocument = gql`
mutation CreateUploadStream($videoName: String!, $deviceType: DeviceTypeEnum, $osVersion: String, $appVersion: String, $browserName: String, $browserVersion: String, $locale: String, $timezone: String, $networkType: String, $ipAddress: String) {
createUploadStream(

View File

@ -0,0 +1,17 @@
query GetAggregateShots($bucketSets: [BucketSetInputGQL!]!) {
getAggregateShots(bucketSets: $bucketSets) {
featureBuckets {
rangeKey
lowerBound
}
targetMetrics {
count
makePercentage
floatFeature {
featureName
average
median
}
}
}
}

30
src/operations/shots.gql Normal file
View File

@ -0,0 +1,30 @@
query GetShots(
$filterInput: FilterInput
$includeCueObjectDistance: Boolean! = false
$includeCueObjectAngle: Boolean! = false
$includeCueBallSpeed: Boolean! = false
$includeShotDirection: Boolean! = false
$includeTargetPocketDistance: Boolean! = false
$includeMake: Boolean! = false
$includeIntendedPocketType: Boolean! = false
) {
getShots(filterInput: $filterInput) {
id
videoId
startFrame
endFrame
createdAt
updatedAt
cueObjectFeatures {
cueObjectDistance @include(if: $includeCueObjectDistance)
cueObjectAngle @include(if: $includeCueObjectAngle)
cueBallSpeed @include(if: $includeCueBallSpeed)
shotDirection @include(if: $includeShotDirection)
}
pocketingIntentionFeatures {
targetPocketDistance @include(if: $includeTargetPocketDistance)
make @include(if: $includeMake)
intendedPocketType @include(if: $includeIntendedPocketType)
}
}
}