Compare commits

...

2 Commits

Author SHA1 Message Date
828140ed2b Updates 2024-02-20 19:18:29 -07:00
9a2cae0c70 Add scripts for checking that graphql-codegen results in no changes 2024-02-20 19:18:29 -07:00
5 changed files with 57 additions and 15 deletions

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 = { 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 = {
@ -161,6 +159,12 @@ 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'
@ -181,6 +185,7 @@ export type Query = {
getShots: Array<ShotGql>; getShots: Array<ShotGql>;
getUser?: Maybe<UserGql>; getUser?: Maybe<UserGql>;
getVideo: VideoGql; getVideo: VideoGql;
getVideoFeedForUser: VideoFeedGql;
}; };
@ -208,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']>;
@ -321,16 +332,23 @@ 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: 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>;
@ -388,7 +406,7 @@ export type GetUploadLinkMutationVariables = Exact<{
}>; }>;
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'];
@ -565,7 +583,6 @@ export const GetUploadLinkDocument = gql`
mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) { mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) {
getUploadLink(videoId: $videoId, segmentIndex: $segmentIndex) { getUploadLink(videoId: $videoId, segmentIndex: $segmentIndex) {
uploadUrl uploadUrl
linksRequested
} }
} }
`; `;

View File

@ -31,7 +31,6 @@ mutation CreateUploadStream(
mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) { mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) {
getUploadLink(videoId: $videoId, segmentIndex: $segmentIndex) { getUploadLink(videoId: $videoId, segmentIndex: $segmentIndex) {
uploadUrl uploadUrl
linksRequested
} }
} }

View File

@ -5,6 +5,7 @@ type Query {
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 {
@ -65,17 +66,18 @@ 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! totalFrames: Int!
stream: UploadStreamGQL stream: UploadStreamGQL
@ -224,6 +226,16 @@ 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!
createUploadStream(uploadMetadata: UploadMetadataInput, videoName: String = null): CreateUploadStreamReturn! createUploadStream(uploadMetadata: UploadMetadataInput, videoName: String = null): CreateUploadStreamReturn!
@ -255,6 +267,4 @@ input UploadMetadataInput {
type GetUploadLinkReturn { type GetUploadLinkReturn {
uploadUrl: String! uploadUrl: String!
linksRequested: Int!
uploadsCompleted: Int!
} }