Compare commits
13 Commits
update-agg
...
cc597b3cfb
| Author | SHA1 | Date | |
|---|---|---|---|
| cc597b3cfb | |||
| 60af058ba4 | |||
| 17aee8f220 | |||
| 828140ed2b | |||
| 9a2cae0c70 | |||
| ce8cfd6a68 | |||
|
|
234d4d0fa9 | ||
|
|
4d05d9a539 | ||
|
|
3f16310f67 | ||
| 204e289627 | |||
| fd731b2ecf | |||
| e733e413ef | |||
| 90fc81776f |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
.direnv
|
||||||
6
bin/assert-no-changes-wrapper.sh
Executable file
6
bin/assert-no-changes-wrapper.sh
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
GQL_DIR=$(dirname $(dirname "$(realpath "$BASH_SOURCE")"))
|
||||||
|
|
||||||
|
cd $GQL_DIR
|
||||||
|
|
||||||
|
nix develop --impure --command bash "$GQL_DIR/bin/assert-no-changes.sh"
|
||||||
10
bin/assert-no-changes.sh
Executable file
10
bin/assert-no-changes.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
git ls-files | xargs md5sum > before.txt
|
||||||
|
|
||||||
|
yarn install
|
||||||
|
yarn graphql-codegen
|
||||||
|
|
||||||
|
git ls-files | xargs md5sum > after.txt
|
||||||
|
|
||||||
|
|
||||||
|
diff before.txt after.txt
|
||||||
175
src/index.tsx
175
src/index.tsx
@@ -115,9 +115,7 @@ export type FilterInput = {
|
|||||||
|
|
||||||
export type GetUploadLinkReturn = {
|
export type GetUploadLinkReturn = {
|
||||||
__typename?: 'GetUploadLinkReturn';
|
__typename?: 'GetUploadLinkReturn';
|
||||||
linksRequested: Scalars['Int']['output'];
|
|
||||||
uploadUrl: Scalars['String']['output'];
|
uploadUrl: Scalars['String']['output'];
|
||||||
uploadsCompleted: Scalars['Int']['output'];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type IntendedPocketTypeInput = {
|
export type IntendedPocketTypeInput = {
|
||||||
@@ -129,7 +127,6 @@ export type Mutation = {
|
|||||||
createBucketSet: BucketSetGql;
|
createBucketSet: BucketSetGql;
|
||||||
createUploadStream: CreateUploadStreamReturn;
|
createUploadStream: CreateUploadStreamReturn;
|
||||||
getUploadLink: GetUploadLinkReturn;
|
getUploadLink: GetUploadLinkReturn;
|
||||||
processVideoSource: ProcessVideoSourceReturn;
|
|
||||||
terminateUploadStream: Scalars['Boolean']['output'];
|
terminateUploadStream: Scalars['Boolean']['output'];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -146,24 +143,28 @@ export type MutationCreateUploadStreamArgs = {
|
|||||||
|
|
||||||
|
|
||||||
export type MutationGetUploadLinkArgs = {
|
export type MutationGetUploadLinkArgs = {
|
||||||
chunkIndex: Scalars['Int']['input'];
|
segmentIndex: Scalars['Int']['input'];
|
||||||
videoId: Scalars['Int']['input'];
|
videoId: Scalars['Int']['input'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export type MutationProcessVideoSourceArgs = {
|
|
||||||
input: ProcessVideoSourceInput;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export type MutationTerminateUploadStreamArgs = {
|
export type MutationTerminateUploadStreamArgs = {
|
||||||
|
gameType?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
tableSize?: InputMaybe<Scalars['String']['input']>;
|
||||||
videoId: Scalars['Int']['input'];
|
videoId: Scalars['Int']['input'];
|
||||||
|
videoName?: InputMaybe<Scalars['String']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type OrFilter = {
|
export type OrFilter = {
|
||||||
filters: Array<FilterInput>;
|
filters: Array<FilterInput>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type PageInfoGql = {
|
||||||
|
__typename?: 'PageInfoGQL';
|
||||||
|
endCursor?: Maybe<Scalars['String']['output']>;
|
||||||
|
hasNextPage: Scalars['Boolean']['output'];
|
||||||
|
};
|
||||||
|
|
||||||
export enum PocketEnum {
|
export enum PocketEnum {
|
||||||
Corner = 'CORNER',
|
Corner = 'CORNER',
|
||||||
Side = 'SIDE'
|
Side = 'SIDE'
|
||||||
@@ -176,22 +177,15 @@ export type PocketingIntentionFeaturesGql = {
|
|||||||
targetPocketDistance?: Maybe<Scalars['Float']['output']>;
|
targetPocketDistance?: Maybe<Scalars['Float']['output']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ProcessVideoSourceInput = {
|
|
||||||
val: Scalars['Int']['input'];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type ProcessVideoSourceReturn = {
|
|
||||||
__typename?: 'ProcessVideoSourceReturn';
|
|
||||||
val: Scalars['Int']['output'];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Query = {
|
export type Query = {
|
||||||
__typename?: 'Query';
|
__typename?: 'Query';
|
||||||
getAggregateShots: Array<AggregateResultGql>;
|
getAggregateShots: Array<AggregateResultGql>;
|
||||||
getBucketSet?: Maybe<BucketSetGql>;
|
getBucketSet?: Maybe<BucketSetGql>;
|
||||||
|
getLoggedInUser?: Maybe<UserGql>;
|
||||||
getShots: Array<ShotGql>;
|
getShots: Array<ShotGql>;
|
||||||
getUser?: Maybe<UserGql>;
|
getUser?: Maybe<UserGql>;
|
||||||
getVideo: VideoGql;
|
getVideo: VideoGql;
|
||||||
|
getVideoFeedForUser: VideoFeedGql;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -219,6 +213,12 @@ export type QueryGetVideoArgs = {
|
|||||||
videoId: Scalars['Int']['input'];
|
videoId: Scalars['Int']['input'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export type QueryGetVideoFeedForUserArgs = {
|
||||||
|
after?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
first?: Scalars['Int']['input'];
|
||||||
|
};
|
||||||
|
|
||||||
export type RangeFilter = {
|
export type RangeFilter = {
|
||||||
greaterThanEqualTo?: InputMaybe<Scalars['Float']['input']>;
|
greaterThanEqualTo?: InputMaybe<Scalars['Float']['input']>;
|
||||||
lessThan?: InputMaybe<Scalars['Float']['input']>;
|
lessThan?: InputMaybe<Scalars['Float']['input']>;
|
||||||
@@ -315,6 +315,7 @@ export type UploadStreamMetadata = {
|
|||||||
export type UserGql = {
|
export type UserGql = {
|
||||||
__typename?: 'UserGQL';
|
__typename?: 'UserGQL';
|
||||||
createdAt?: Maybe<Scalars['DateTime']['output']>;
|
createdAt?: Maybe<Scalars['DateTime']['output']>;
|
||||||
|
firebaseUid: Scalars['String']['output'];
|
||||||
id: Scalars['Int']['output'];
|
id: Scalars['Int']['output'];
|
||||||
statistics: UserStatisticsGql;
|
statistics: UserStatisticsGql;
|
||||||
updatedAt?: Maybe<Scalars['DateTime']['output']>;
|
updatedAt?: Maybe<Scalars['DateTime']['output']>;
|
||||||
@@ -331,20 +332,26 @@ export type UserStatisticsGql = {
|
|||||||
totalShotsMade: Scalars['Int']['output'];
|
totalShotsMade: Scalars['Int']['output'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type VideoFeedGql = {
|
||||||
|
__typename?: 'VideoFeedGQL';
|
||||||
|
pageInfo: PageInfoGql;
|
||||||
|
videos: Array<VideoGql>;
|
||||||
|
};
|
||||||
|
|
||||||
export type VideoGql = {
|
export type VideoGql = {
|
||||||
__typename?: 'VideoGQL';
|
__typename?: 'VideoGQL';
|
||||||
averageTimeBetweenShots?: Maybe<Scalars['Decimal']['output']>;
|
averageTimeBetweenShots?: Maybe<Scalars['Float']['output']>;
|
||||||
createdAt: Scalars['DateTime']['output'];
|
createdAt: Scalars['DateTime']['output'];
|
||||||
elapsedTime: Scalars['Decimal']['output'];
|
elapsedTime?: Maybe<Scalars['Float']['output']>;
|
||||||
endTime: Scalars['DateTime']['output'];
|
endTime: Scalars['DateTime']['output'];
|
||||||
framesPerSecond: Scalars['Int']['output'];
|
framesPerSecond: Scalars['Int']['output'];
|
||||||
id: Scalars['Int']['output'];
|
id: Scalars['Int']['output'];
|
||||||
makePercentage: Scalars['Decimal']['output'];
|
makePercentage: Scalars['Float']['output'];
|
||||||
medianRun: Scalars['Decimal']['output'];
|
medianRun?: Maybe<Scalars['Float']['output']>;
|
||||||
|
name: Scalars['String']['output'];
|
||||||
shots: Array<ShotGql>;
|
shots: Array<ShotGql>;
|
||||||
startTime: Scalars['DateTime']['output'];
|
startTime: Scalars['DateTime']['output'];
|
||||||
stream?: Maybe<UploadStreamGql>;
|
stream?: Maybe<UploadStreamGql>;
|
||||||
totalFrames: Scalars['Int']['output'];
|
|
||||||
totalShots: Scalars['Int']['output'];
|
totalShots: Scalars['Int']['output'];
|
||||||
totalShotsMade: Scalars['Int']['output'];
|
totalShotsMade: Scalars['Int']['output'];
|
||||||
updatedAt: Scalars['DateTime']['output'];
|
updatedAt: Scalars['DateTime']['output'];
|
||||||
@@ -362,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 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<{
|
export type GetShotsQueryVariables = Exact<{
|
||||||
filterInput?: InputMaybe<FilterInput>;
|
filterInput?: InputMaybe<FilterInput>;
|
||||||
includeCueObjectDistance?: Scalars['Boolean']['input'];
|
includeCueObjectDistance?: Scalars['Boolean']['input'];
|
||||||
@@ -394,14 +416,17 @@ export type CreateUploadStreamMutation = { __typename?: 'Mutation', createUpload
|
|||||||
|
|
||||||
export type GetUploadLinkMutationVariables = Exact<{
|
export type GetUploadLinkMutationVariables = Exact<{
|
||||||
videoId: Scalars['Int']['input'];
|
videoId: Scalars['Int']['input'];
|
||||||
chunkIndex: Scalars['Int']['input'];
|
segmentIndex: Scalars['Int']['input'];
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type GetUploadLinkMutation = { __typename?: 'Mutation', getUploadLink: { __typename?: 'GetUploadLinkReturn', uploadUrl: string, linksRequested: number } };
|
export type GetUploadLinkMutation = { __typename?: 'Mutation', getUploadLink: { __typename?: 'GetUploadLinkReturn', uploadUrl: string } };
|
||||||
|
|
||||||
export type TerminateUploadStreamMutationVariables = Exact<{
|
export type TerminateUploadStreamMutationVariables = Exact<{
|
||||||
videoId: Scalars['Int']['input'];
|
videoId: Scalars['Int']['input'];
|
||||||
|
videoName?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
gameType?: InputMaybe<Scalars['String']['input']>;
|
||||||
|
tableSize?: InputMaybe<Scalars['String']['input']>;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
@@ -460,6 +485,87 @@ export type GetAggregateShotsQueryHookResult = ReturnType<typeof useGetAggregate
|
|||||||
export type GetAggregateShotsLazyQueryHookResult = ReturnType<typeof useGetAggregateShotsLazyQuery>;
|
export type GetAggregateShotsLazyQueryHookResult = ReturnType<typeof useGetAggregateShotsLazyQuery>;
|
||||||
export type GetAggregateShotsSuspenseQueryHookResult = ReturnType<typeof useGetAggregateShotsSuspenseQuery>;
|
export type GetAggregateShotsSuspenseQueryHookResult = ReturnType<typeof useGetAggregateShotsSuspenseQuery>;
|
||||||
export type GetAggregateShotsQueryResult = Apollo.QueryResult<GetAggregateShotsQuery, GetAggregateShotsQueryVariables>;
|
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`
|
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) {
|
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) {
|
getShots(filterInput: $filterInput) {
|
||||||
@@ -569,10 +675,9 @@ export type CreateUploadStreamMutationHookResult = ReturnType<typeof useCreateUp
|
|||||||
export type CreateUploadStreamMutationResult = Apollo.MutationResult<CreateUploadStreamMutation>;
|
export type CreateUploadStreamMutationResult = Apollo.MutationResult<CreateUploadStreamMutation>;
|
||||||
export type CreateUploadStreamMutationOptions = Apollo.BaseMutationOptions<CreateUploadStreamMutation, CreateUploadStreamMutationVariables>;
|
export type CreateUploadStreamMutationOptions = Apollo.BaseMutationOptions<CreateUploadStreamMutation, CreateUploadStreamMutationVariables>;
|
||||||
export const GetUploadLinkDocument = gql`
|
export const GetUploadLinkDocument = gql`
|
||||||
mutation GetUploadLink($videoId: Int!, $chunkIndex: Int!) {
|
mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) {
|
||||||
getUploadLink(videoId: $videoId, chunkIndex: $chunkIndex) {
|
getUploadLink(videoId: $videoId, segmentIndex: $segmentIndex) {
|
||||||
uploadUrl
|
uploadUrl
|
||||||
linksRequested
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@@ -592,7 +697,7 @@ export type GetUploadLinkMutationFn = Apollo.MutationFunction<GetUploadLinkMutat
|
|||||||
* const [getUploadLinkMutation, { data, loading, error }] = useGetUploadLinkMutation({
|
* const [getUploadLinkMutation, { data, loading, error }] = useGetUploadLinkMutation({
|
||||||
* variables: {
|
* variables: {
|
||||||
* videoId: // value for 'videoId'
|
* videoId: // value for 'videoId'
|
||||||
* chunkIndex: // value for 'chunkIndex'
|
* segmentIndex: // value for 'segmentIndex'
|
||||||
* },
|
* },
|
||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
@@ -604,8 +709,13 @@ export type GetUploadLinkMutationHookResult = ReturnType<typeof useGetUploadLink
|
|||||||
export type GetUploadLinkMutationResult = Apollo.MutationResult<GetUploadLinkMutation>;
|
export type GetUploadLinkMutationResult = Apollo.MutationResult<GetUploadLinkMutation>;
|
||||||
export type GetUploadLinkMutationOptions = Apollo.BaseMutationOptions<GetUploadLinkMutation, GetUploadLinkMutationVariables>;
|
export type GetUploadLinkMutationOptions = Apollo.BaseMutationOptions<GetUploadLinkMutation, GetUploadLinkMutationVariables>;
|
||||||
export const TerminateUploadStreamDocument = gql`
|
export const TerminateUploadStreamDocument = gql`
|
||||||
mutation TerminateUploadStream($videoId: Int!) {
|
mutation TerminateUploadStream($videoId: Int!, $videoName: String, $gameType: String, $tableSize: String) {
|
||||||
terminateUploadStream(videoId: $videoId)
|
terminateUploadStream(
|
||||||
|
videoId: $videoId
|
||||||
|
videoName: $videoName
|
||||||
|
gameType: $gameType
|
||||||
|
tableSize: $tableSize
|
||||||
|
)
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export type TerminateUploadStreamMutationFn = Apollo.MutationFunction<TerminateUploadStreamMutation, TerminateUploadStreamMutationVariables>;
|
export type TerminateUploadStreamMutationFn = Apollo.MutationFunction<TerminateUploadStreamMutation, TerminateUploadStreamMutationVariables>;
|
||||||
@@ -624,6 +734,9 @@ export type TerminateUploadStreamMutationFn = Apollo.MutationFunction<TerminateU
|
|||||||
* const [terminateUploadStreamMutation, { data, loading, error }] = useTerminateUploadStreamMutation({
|
* const [terminateUploadStreamMutation, { data, loading, error }] = useTerminateUploadStreamMutation({
|
||||||
* variables: {
|
* variables: {
|
||||||
* videoId: // value for 'videoId'
|
* videoId: // value for 'videoId'
|
||||||
|
* videoName: // value for 'videoName'
|
||||||
|
* gameType: // value for 'gameType'
|
||||||
|
* tableSize: // value for 'tableSize'
|
||||||
* },
|
* },
|
||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
|
|||||||
48
src/operations/feed.gql
Normal file
48
src/operations/feed.gql
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
mutation CreateUploadStream(
|
mutation CreateUploadStream(
|
||||||
$videoName: String!,
|
$videoName: String!
|
||||||
$deviceType: DeviceTypeEnum,
|
$deviceType: DeviceTypeEnum
|
||||||
$osVersion: String,
|
$osVersion: String
|
||||||
$appVersion: String,
|
$appVersion: String
|
||||||
$browserName: String,
|
$browserName: String
|
||||||
$browserVersion: String,
|
$browserVersion: String
|
||||||
$locale: String,
|
$locale: String
|
||||||
$timezone: String,
|
$timezone: String
|
||||||
$networkType: String,
|
$networkType: String
|
||||||
$ipAddress: String
|
$ipAddress: String
|
||||||
) {
|
) {
|
||||||
createUploadStream(
|
createUploadStream(
|
||||||
@@ -28,13 +28,22 @@ mutation CreateUploadStream(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mutation GetUploadLink($videoId: Int!, $chunkIndex: Int!) {
|
mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) {
|
||||||
getUploadLink(videoId: $videoId, chunkIndex: $chunkIndex) {
|
getUploadLink(videoId: $videoId, segmentIndex: $segmentIndex) {
|
||||||
uploadUrl
|
uploadUrl
|
||||||
linksRequested
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mutation TerminateUploadStream($videoId: Int!) {
|
mutation TerminateUploadStream(
|
||||||
terminateUploadStream(videoId: $videoId)
|
$videoId: Int!
|
||||||
|
$videoName: String
|
||||||
|
$gameType: String
|
||||||
|
$tableSize: String
|
||||||
|
) {
|
||||||
|
terminateUploadStream(
|
||||||
|
videoId: $videoId
|
||||||
|
videoName: $videoName
|
||||||
|
gameType: $gameType
|
||||||
|
tableSize: $tableSize
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
type Query {
|
type Query {
|
||||||
getAggregateShots(bucketSets: [BucketSetInputGQL!]!): [AggregateResultGQL!]!
|
getAggregateShots(bucketSets: [BucketSetInputGQL!]!): [AggregateResultGQL!]!
|
||||||
getUser(userId: Int!): UserGQL
|
getUser(userId: Int!): UserGQL
|
||||||
|
getLoggedInUser: UserGQL
|
||||||
getVideo(videoId: Int!): VideoGQL!
|
getVideo(videoId: Int!): VideoGQL!
|
||||||
getShots(filterInput: FilterInput = null): [ShotGQL!]!
|
getShots(filterInput: FilterInput = null): [ShotGQL!]!
|
||||||
getBucketSet(keyName: String!): BucketSetGQL
|
getBucketSet(keyName: String!): BucketSetGQL
|
||||||
|
getVideoFeedForUser(first: Int! = 5, after: String = null): VideoFeedGQL!
|
||||||
}
|
}
|
||||||
|
|
||||||
type AggregateResultGQL {
|
type AggregateResultGQL {
|
||||||
@@ -40,6 +42,7 @@ input BucketInputGQL {
|
|||||||
|
|
||||||
type UserGQL {
|
type UserGQL {
|
||||||
id: Int!
|
id: Int!
|
||||||
|
firebaseUid: String!
|
||||||
username: String!
|
username: String!
|
||||||
createdAt: DateTime
|
createdAt: DateTime
|
||||||
updatedAt: DateTime
|
updatedAt: DateTime
|
||||||
@@ -63,19 +66,19 @@ scalar Decimal
|
|||||||
|
|
||||||
type VideoGQL {
|
type VideoGQL {
|
||||||
id: Int!
|
id: Int!
|
||||||
|
name: String!
|
||||||
totalShotsMade: Int!
|
totalShotsMade: Int!
|
||||||
totalShots: Int!
|
totalShots: Int!
|
||||||
makePercentage: Decimal!
|
makePercentage: Float!
|
||||||
medianRun: Decimal!
|
medianRun: Float
|
||||||
averageTimeBetweenShots: Decimal
|
averageTimeBetweenShots: Float
|
||||||
createdAt: DateTime!
|
createdAt: DateTime!
|
||||||
updatedAt: DateTime!
|
updatedAt: DateTime!
|
||||||
shots: [ShotGQL!]!
|
shots: [ShotGQL!]!
|
||||||
startTime: DateTime!
|
startTime: DateTime!
|
||||||
endTime: DateTime!
|
endTime: DateTime!
|
||||||
elapsedTime: Decimal!
|
elapsedTime: Float
|
||||||
framesPerSecond: Int!
|
framesPerSecond: Int!
|
||||||
totalFrames: Int!
|
|
||||||
stream: UploadStreamGQL
|
stream: UploadStreamGQL
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,12 +225,21 @@ type BucketSetGQL {
|
|||||||
buckets: [BucketGQL!]!
|
buckets: [BucketGQL!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type VideoFeedGQL {
|
||||||
|
videos: [VideoGQL!]!
|
||||||
|
pageInfo: PageInfoGQL!
|
||||||
|
}
|
||||||
|
|
||||||
|
type PageInfoGQL {
|
||||||
|
hasNextPage: Boolean!
|
||||||
|
endCursor: String
|
||||||
|
}
|
||||||
|
|
||||||
type Mutation {
|
type Mutation {
|
||||||
createBucketSet(params: CreateBucketSetInput!): BucketSetGQL!
|
createBucketSet(params: CreateBucketSetInput!): BucketSetGQL!
|
||||||
processVideoSource(input: ProcessVideoSourceInput!): ProcessVideoSourceReturn!
|
|
||||||
createUploadStream(uploadMetadata: UploadMetadataInput, videoName: String = null): CreateUploadStreamReturn!
|
createUploadStream(uploadMetadata: UploadMetadataInput, videoName: String = null): CreateUploadStreamReturn!
|
||||||
getUploadLink(videoId: Int!, chunkIndex: Int!): GetUploadLinkReturn!
|
getUploadLink(videoId: Int!, segmentIndex: Int!): GetUploadLinkReturn!
|
||||||
terminateUploadStream(videoId: Int!): Boolean!
|
terminateUploadStream(videoId: Int!, videoName: String = null, gameType: String = null, tableSize: String = null): Boolean!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateBucketSetInput {
|
input CreateBucketSetInput {
|
||||||
@@ -236,14 +248,6 @@ input CreateBucketSetInput {
|
|||||||
buckets: [BucketInputGQL!]!
|
buckets: [BucketInputGQL!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProcessVideoSourceReturn {
|
|
||||||
val: Int!
|
|
||||||
}
|
|
||||||
|
|
||||||
input ProcessVideoSourceInput {
|
|
||||||
val: Int!
|
|
||||||
}
|
|
||||||
|
|
||||||
type CreateUploadStreamReturn {
|
type CreateUploadStreamReturn {
|
||||||
videoId: Int!
|
videoId: Int!
|
||||||
}
|
}
|
||||||
@@ -262,6 +266,4 @@ input UploadMetadataInput {
|
|||||||
|
|
||||||
type GetUploadLinkReturn {
|
type GetUploadLinkReturn {
|
||||||
uploadUrl: String!
|
uploadUrl: String!
|
||||||
linksRequested: Int!
|
|
||||||
uploadsCompleted: Int!
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user