Compare commits

..

10 Commits

6 changed files with 110 additions and 61 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
node_modules
dist
.direnv

View 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
View 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

View File

@@ -115,9 +115,7 @@ export type FilterInput = {
export type GetUploadLinkReturn = {
__typename?: 'GetUploadLinkReturn';
linksRequested: Scalars['Int']['output'];
uploadUrl: Scalars['String']['output'];
uploadsCompleted: Scalars['Int']['output'];
};
export type IntendedPocketTypeInput = {
@@ -129,7 +127,6 @@ export type Mutation = {
createBucketSet: BucketSetGql;
createUploadStream: CreateUploadStreamReturn;
getUploadLink: GetUploadLinkReturn;
processVideoSource: ProcessVideoSourceReturn;
terminateUploadStream: Scalars['Boolean']['output'];
};
@@ -146,24 +143,28 @@ export type MutationCreateUploadStreamArgs = {
export type MutationGetUploadLinkArgs = {
chunkIndex: Scalars['Int']['input'];
segmentIndex: Scalars['Int']['input'];
videoId: Scalars['Int']['input'];
};
export type MutationProcessVideoSourceArgs = {
input: ProcessVideoSourceInput;
};
export type MutationTerminateUploadStreamArgs = {
gameType?: InputMaybe<Scalars['String']['input']>;
tableSize?: InputMaybe<Scalars['String']['input']>;
videoId: Scalars['Int']['input'];
videoName?: InputMaybe<Scalars['String']['input']>;
};
export type OrFilter = {
filters: Array<FilterInput>;
};
export type PageInfoGql = {
__typename?: 'PageInfoGQL';
endCursor?: Maybe<Scalars['String']['output']>;
hasNextPage: Scalars['Boolean']['output'];
};
export enum PocketEnum {
Corner = 'CORNER',
Side = 'SIDE'
@@ -176,22 +177,15 @@ export type PocketingIntentionFeaturesGql = {
targetPocketDistance?: Maybe<Scalars['Float']['output']>;
};
export type ProcessVideoSourceInput = {
val: Scalars['Int']['input'];
};
export type ProcessVideoSourceReturn = {
__typename?: 'ProcessVideoSourceReturn';
val: Scalars['Int']['output'];
};
export type Query = {
__typename?: 'Query';
getAggregateShots: Array<AggregateResultGql>;
getBucketSet?: Maybe<BucketSetGql>;
getLoggedInUser?: Maybe<UserGql>;
getShots: Array<ShotGql>;
getUser?: Maybe<UserGql>;
getVideo: VideoGql;
getVideoFeedForUser: VideoFeedGql;
};
@@ -219,6 +213,12 @@ export type QueryGetVideoArgs = {
videoId: Scalars['Int']['input'];
};
export type QueryGetVideoFeedForUserArgs = {
after?: InputMaybe<Scalars['String']['input']>;
first?: Scalars['Int']['input'];
};
export type RangeFilter = {
greaterThanEqualTo?: InputMaybe<Scalars['Float']['input']>;
lessThan?: InputMaybe<Scalars['Float']['input']>;
@@ -315,6 +315,7 @@ export type UploadStreamMetadata = {
export type UserGql = {
__typename?: 'UserGQL';
createdAt?: Maybe<Scalars['DateTime']['output']>;
firebaseUid: Scalars['String']['output'];
id: Scalars['Int']['output'];
statistics: UserStatisticsGql;
updatedAt?: Maybe<Scalars['DateTime']['output']>;
@@ -331,16 +332,23 @@ export type UserStatisticsGql = {
totalShotsMade: Scalars['Int']['output'];
};
export type VideoFeedGql = {
__typename?: 'VideoFeedGQL';
pageInfo: PageInfoGql;
videos: Array<VideoGql>;
};
export type VideoGql = {
__typename?: 'VideoGQL';
averageTimeBetweenShots?: Maybe<Scalars['Decimal']['output']>;
averageTimeBetweenShots?: Maybe<Scalars['Float']['output']>;
createdAt: Scalars['DateTime']['output'];
elapsedTime: Scalars['Decimal']['output'];
elapsedTime: Scalars['Float']['output'];
endTime: Scalars['DateTime']['output'];
framesPerSecond: Scalars['Int']['output'];
id: Scalars['Int']['output'];
makePercentage: Scalars['Decimal']['output'];
medianRun: Scalars['Decimal']['output'];
makePercentage: Scalars['Float']['output'];
medianRun?: Maybe<Scalars['Float']['output']>;
name: Scalars['String']['output'];
shots: Array<ShotGql>;
startTime: Scalars['DateTime']['output'];
stream?: Maybe<UploadStreamGql>;
@@ -394,14 +402,17 @@ export type CreateUploadStreamMutation = { __typename?: 'Mutation', createUpload
export type GetUploadLinkMutationVariables = Exact<{
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<{
videoId: Scalars['Int']['input'];
videoName?: InputMaybe<Scalars['String']['input']>;
gameType?: InputMaybe<Scalars['String']['input']>;
tableSize?: InputMaybe<Scalars['String']['input']>;
}>;
@@ -569,10 +580,9 @@ export type CreateUploadStreamMutationHookResult = ReturnType<typeof useCreateUp
export type CreateUploadStreamMutationResult = Apollo.MutationResult<CreateUploadStreamMutation>;
export type CreateUploadStreamMutationOptions = Apollo.BaseMutationOptions<CreateUploadStreamMutation, CreateUploadStreamMutationVariables>;
export const GetUploadLinkDocument = gql`
mutation GetUploadLink($videoId: Int!, $chunkIndex: Int!) {
getUploadLink(videoId: $videoId, chunkIndex: $chunkIndex) {
mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) {
getUploadLink(videoId: $videoId, segmentIndex: $segmentIndex) {
uploadUrl
linksRequested
}
}
`;
@@ -592,7 +602,7 @@ export type GetUploadLinkMutationFn = Apollo.MutationFunction<GetUploadLinkMutat
* const [getUploadLinkMutation, { data, loading, error }] = useGetUploadLinkMutation({
* variables: {
* videoId: // value for 'videoId'
* chunkIndex: // value for 'chunkIndex'
* segmentIndex: // value for 'segmentIndex'
* },
* });
*/
@@ -604,8 +614,13 @@ export type GetUploadLinkMutationHookResult = ReturnType<typeof useGetUploadLink
export type GetUploadLinkMutationResult = Apollo.MutationResult<GetUploadLinkMutation>;
export type GetUploadLinkMutationOptions = Apollo.BaseMutationOptions<GetUploadLinkMutation, GetUploadLinkMutationVariables>;
export const TerminateUploadStreamDocument = gql`
mutation TerminateUploadStream($videoId: Int!) {
terminateUploadStream(videoId: $videoId)
mutation TerminateUploadStream($videoId: Int!, $videoName: String, $gameType: String, $tableSize: String) {
terminateUploadStream(
videoId: $videoId
videoName: $videoName
gameType: $gameType
tableSize: $tableSize
)
}
`;
export type TerminateUploadStreamMutationFn = Apollo.MutationFunction<TerminateUploadStreamMutation, TerminateUploadStreamMutationVariables>;
@@ -624,6 +639,9 @@ export type TerminateUploadStreamMutationFn = Apollo.MutationFunction<TerminateU
* const [terminateUploadStreamMutation, { data, loading, error }] = useTerminateUploadStreamMutation({
* variables: {
* videoId: // value for 'videoId'
* videoName: // value for 'videoName'
* gameType: // value for 'gameType'
* tableSize: // value for 'tableSize'
* },
* });
*/

View File

@@ -1,13 +1,13 @@
mutation CreateUploadStream(
$videoName: String!,
$deviceType: DeviceTypeEnum,
$osVersion: String,
$appVersion: String,
$browserName: String,
$browserVersion: String,
$locale: String,
$timezone: String,
$networkType: String,
$videoName: String!
$deviceType: DeviceTypeEnum
$osVersion: String
$appVersion: String
$browserName: String
$browserVersion: String
$locale: String
$timezone: String
$networkType: String
$ipAddress: String
) {
createUploadStream(
@@ -28,13 +28,22 @@ mutation CreateUploadStream(
}
}
mutation GetUploadLink($videoId: Int!, $chunkIndex: Int!) {
getUploadLink(videoId: $videoId, chunkIndex: $chunkIndex) {
mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) {
getUploadLink(videoId: $videoId, segmentIndex: $segmentIndex) {
uploadUrl
linksRequested
}
}
mutation TerminateUploadStream($videoId: Int!) {
terminateUploadStream(videoId: $videoId)
mutation TerminateUploadStream(
$videoId: Int!
$videoName: String
$gameType: String
$tableSize: String
) {
terminateUploadStream(
videoId: $videoId
videoName: $videoName
gameType: $gameType
tableSize: $tableSize
)
}

View File

@@ -1,9 +1,11 @@
type Query {
getAggregateShots(bucketSets: [BucketSetInputGQL!]!): [AggregateResultGQL!]!
getUser(userId: Int!): UserGQL
getLoggedInUser: UserGQL
getVideo(videoId: Int!): VideoGQL!
getShots(filterInput: FilterInput = null): [ShotGQL!]!
getBucketSet(keyName: String!): BucketSetGQL
getVideoFeedForUser(first: Int! = 5, after: String = null): VideoFeedGQL!
}
type AggregateResultGQL {
@@ -40,6 +42,7 @@ input BucketInputGQL {
type UserGQL {
id: Int!
firebaseUid: String!
username: String!
createdAt: DateTime
updatedAt: DateTime
@@ -63,17 +66,18 @@ scalar Decimal
type VideoGQL {
id: Int!
name: String!
totalShotsMade: Int!
totalShots: Int!
makePercentage: Decimal!
medianRun: Decimal!
averageTimeBetweenShots: Decimal
makePercentage: Float!
medianRun: Float
averageTimeBetweenShots: Float
createdAt: DateTime!
updatedAt: DateTime!
shots: [ShotGQL!]!
startTime: DateTime!
endTime: DateTime!
elapsedTime: Decimal!
elapsedTime: Float!
framesPerSecond: Int!
totalFrames: Int!
stream: UploadStreamGQL
@@ -222,12 +226,21 @@ type BucketSetGQL {
buckets: [BucketGQL!]!
}
type VideoFeedGQL {
videos: [VideoGQL!]!
pageInfo: PageInfoGQL!
}
type PageInfoGQL {
hasNextPage: Boolean!
endCursor: String
}
type Mutation {
createBucketSet(params: CreateBucketSetInput!): BucketSetGQL!
processVideoSource(input: ProcessVideoSourceInput!): ProcessVideoSourceReturn!
createUploadStream(uploadMetadata: UploadMetadataInput, videoName: String = null): CreateUploadStreamReturn!
getUploadLink(videoId: Int!, chunkIndex: Int!): GetUploadLinkReturn!
terminateUploadStream(videoId: Int!): Boolean!
getUploadLink(videoId: Int!, segmentIndex: Int!): GetUploadLinkReturn!
terminateUploadStream(videoId: Int!, videoName: String = null, gameType: String = null, tableSize: String = null): Boolean!
}
input CreateBucketSetInput {
@@ -236,14 +249,6 @@ input CreateBucketSetInput {
buckets: [BucketInputGQL!]!
}
type ProcessVideoSourceReturn {
val: Int!
}
input ProcessVideoSourceInput {
val: Int!
}
type CreateUploadStreamReturn {
videoId: Int!
}
@@ -262,6 +267,4 @@ input UploadMetadataInput {
type GetUploadLinkReturn {
uploadUrl: String!
linksRequested: Int!
uploadsCompleted: Int!
}