Compare commits

...

3 Commits

Author SHA1 Message Date
cc597b3cfb Merge pull request 'Create gql feed' (#4) from kat/update-video-gql into master
Reviewed-on: #4
2024-02-21 19:18:20 -07:00
60af058ba4 Create feed 2024-02-21 19:13:30 -07:00
17aee8f220 Drop frame count from videl gql 2024-02-21 17:54:00 -07:00
3 changed files with 146 additions and 4 deletions

View File

@ -342,7 +342,7 @@ export type VideoGql = {
__typename?: 'VideoGQL';
averageTimeBetweenShots?: Maybe<Scalars['Float']['output']>;
createdAt: Scalars['DateTime']['output'];
elapsedTime: Scalars['Float']['output'];
elapsedTime?: Maybe<Scalars['Float']['output']>;
endTime: Scalars['DateTime']['output'];
framesPerSecond: Scalars['Int']['output'];
id: Scalars['Int']['output'];
@ -352,7 +352,6 @@ export type VideoGql = {
shots: Array<ShotGql>;
startTime: Scalars['DateTime']['output'];
stream?: Maybe<UploadStreamGql>;
totalFrames: Scalars['Int']['output'];
totalShots: Scalars['Int']['output'];
totalShotsMade: Scalars['Int']['output'];
updatedAt: Scalars['DateTime']['output'];
@ -370,6 +369,21 @@ export type GetAggregateShotsQueryVariables = Exact<{
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 GetFeedQueryVariables = Exact<{
first?: Scalars['Int']['input'];
after?: InputMaybe<Scalars['String']['input']>;
includeTotalShotsMade?: Scalars['Boolean']['input'];
includeMakePercentage?: Scalars['Boolean']['input'];
includeMedianRun?: Scalars['Boolean']['input'];
includeAverageTimeBetweenShots?: Scalars['Boolean']['input'];
includeElapsedTime?: Scalars['Boolean']['input'];
includeFramesPerSecond?: Scalars['Boolean']['input'];
includeStream?: Scalars['Boolean']['input'];
}>;
export type GetFeedQuery = { __typename?: 'Query', getVideoFeedForUser: { __typename?: 'VideoFeedGQL', videos: Array<{ __typename?: 'VideoGQL', id: number, name: string, totalShotsMade?: number, totalShots: number, makePercentage?: number, medianRun?: number | null, averageTimeBetweenShots?: number | null, createdAt: any, updatedAt: any, startTime: any, endTime: any, elapsedTime?: number | null, shots: Array<{ __typename?: 'ShotGQL', id?: number | null, videoId?: number | null, startFrame?: number | null, endFrame?: number | null, createdAt?: any | null, updatedAt?: any | null }>, stream?: { __typename?: 'UploadStreamGQL', id: string, linksRequested: number, uploadsCompleted: number, isCompleted: boolean, createdAt: any, updatedAt: any } | null }>, pageInfo: { __typename?: 'PageInfoGQL', hasNextPage: boolean, endCursor?: string | null } } };
export type GetShotsQueryVariables = Exact<{
filterInput?: InputMaybe<FilterInput>;
includeCueObjectDistance?: Scalars['Boolean']['input'];
@ -471,6 +485,87 @@ export type GetAggregateShotsQueryHookResult = ReturnType<typeof useGetAggregate
export type GetAggregateShotsLazyQueryHookResult = ReturnType<typeof useGetAggregateShotsLazyQuery>;
export type GetAggregateShotsSuspenseQueryHookResult = ReturnType<typeof useGetAggregateShotsSuspenseQuery>;
export type GetAggregateShotsQueryResult = Apollo.QueryResult<GetAggregateShotsQuery, GetAggregateShotsQueryVariables>;
export const GetFeedDocument = gql`
query GetFeed($first: Int! = 5, $after: String = null, $includeTotalShotsMade: Boolean! = false, $includeMakePercentage: Boolean! = false, $includeMedianRun: Boolean! = false, $includeAverageTimeBetweenShots: Boolean! = false, $includeElapsedTime: Boolean! = false, $includeFramesPerSecond: Boolean! = false, $includeStream: Boolean! = false) {
getVideoFeedForUser(first: $first, after: $after) {
videos {
id
name
totalShotsMade @include(if: $includeTotalShotsMade)
totalShots
makePercentage @include(if: $includeMakePercentage)
medianRun @include(if: $includeMedianRun)
averageTimeBetweenShots @include(if: $includeAverageTimeBetweenShots)
createdAt
updatedAt
shots {
id
videoId
startFrame
endFrame
createdAt
updatedAt
}
startTime
endTime
elapsedTime @include(if: $includeElapsedTime)
stream @include(if: $includeStream) {
id
linksRequested
uploadsCompleted
isCompleted
createdAt
updatedAt
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
`;
/**
* __useGetFeedQuery__
*
* To run a query within a React component, call `useGetFeedQuery` and pass it any options that fit your needs.
* When your component renders, `useGetFeedQuery` 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 } = useGetFeedQuery({
* variables: {
* first: // value for 'first'
* after: // value for 'after'
* includeTotalShotsMade: // value for 'includeTotalShotsMade'
* includeMakePercentage: // value for 'includeMakePercentage'
* includeMedianRun: // value for 'includeMedianRun'
* includeAverageTimeBetweenShots: // value for 'includeAverageTimeBetweenShots'
* includeElapsedTime: // value for 'includeElapsedTime'
* includeFramesPerSecond: // value for 'includeFramesPerSecond'
* includeStream: // value for 'includeStream'
* },
* });
*/
export function useGetFeedQuery(baseOptions?: Apollo.QueryHookOptions<GetFeedQuery, GetFeedQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetFeedQuery, GetFeedQueryVariables>(GetFeedDocument, options);
}
export function useGetFeedLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetFeedQuery, GetFeedQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetFeedQuery, GetFeedQueryVariables>(GetFeedDocument, options);
}
export function useGetFeedSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions<GetFeedQuery, GetFeedQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useSuspenseQuery<GetFeedQuery, GetFeedQueryVariables>(GetFeedDocument, options);
}
export type GetFeedQueryHookResult = ReturnType<typeof useGetFeedQuery>;
export type GetFeedLazyQueryHookResult = ReturnType<typeof useGetFeedLazyQuery>;
export type GetFeedSuspenseQueryHookResult = ReturnType<typeof useGetFeedSuspenseQuery>;
export type GetFeedQueryResult = Apollo.QueryResult<GetFeedQuery, GetFeedQueryVariables>;
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) {

48
src/operations/feed.gql Normal file
View File

@ -0,0 +1,48 @@
query GetFeed(
$first: Int! = 5,
$after: String = null,
$includeTotalShotsMade: Boolean! = false,
$includeMakePercentage: Boolean! = false,
$includeMedianRun: Boolean! = false,
$includeAverageTimeBetweenShots: Boolean! = false,
$includeElapsedTime: Boolean! = false,
$includeFramesPerSecond: Boolean! = false,
$includeStream: Boolean! = false
) {
getVideoFeedForUser(first: $first, after: $after) {
videos {
id
name
totalShotsMade @include(if: $includeTotalShotsMade)
totalShots
makePercentage @include(if: $includeMakePercentage)
medianRun @include(if: $includeMedianRun)
averageTimeBetweenShots @include(if: $includeAverageTimeBetweenShots)
createdAt
updatedAt
shots {
id
videoId
startFrame
endFrame
createdAt
updatedAt
}
startTime
endTime
elapsedTime @include(if: $includeElapsedTime)
stream @include(if: $includeStream) {
id
linksRequested
uploadsCompleted
isCompleted
createdAt
updatedAt
}
}
pageInfo {
hasNextPage
endCursor
}
}
}

View File

@ -77,9 +77,8 @@ type VideoGQL {
shots: [ShotGQL!]!
startTime: DateTime!
endTime: DateTime!
elapsedTime: Float!
elapsedTime: Float
framesPerSecond: Int!
totalFrames: Int!
stream: UploadStreamGQL
}