diff --git a/src/index.tsx b/src/index.tsx index da4374f..2fc80cc 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,41 +1,28 @@ -import * as Apollo from "@apollo/client"; -import { gql } from "@apollo/client"; +import { gql } from '@apollo/client'; +import * as Apollo from '@apollo/client'; export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { - [K in keyof T]: T[K]; -}; -export type MakeOptional = Omit & { - [SubKey in K]?: Maybe; -}; -export type MakeMaybe = Omit & { - [SubKey in K]: Maybe; -}; -export type MakeEmpty< - T extends { [key: string]: unknown }, - K extends keyof T, -> = { [_ in K]?: never }; -export type Incremental = - | T - | { - [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never; - }; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type MakeEmpty = { [_ in K]?: never }; +export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; const defaultOptions = {} as const; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { - ID: { input: string; output: string }; - String: { input: string; output: string }; - Boolean: { input: boolean; output: boolean }; - Int: { input: number; output: number }; - Float: { input: number; output: number }; + ID: { input: string; output: string; } + String: { input: string; output: string; } + Boolean: { input: boolean; output: boolean; } + Int: { input: number; output: number; } + Float: { input: number; output: number; } /** Date with time (isoformat) */ - DateTime: { input: any; output: any }; + DateTime: { input: any; output: any; } /** Decimal (fixed-point) */ - Decimal: { input: any; output: any }; + Decimal: { input: any; output: any; } }; export type AggregateResultGql = { - __typename?: "AggregateResultGQL"; + __typename?: 'AggregateResultGQL'; featureBuckets: Array; targetMetrics: Array; }; @@ -45,44 +32,44 @@ export type AndFilter = { }; export type BankFeaturesGql = { - __typename?: "BankFeaturesGQL"; - bankAngle: Scalars["Float"]["output"]; - distance: Scalars["Float"]["output"]; + __typename?: 'BankFeaturesGQL'; + bankAngle: Scalars['Float']['output']; + distance: Scalars['Float']['output']; wallsHit: Array; }; export type BucketGql = { - __typename?: "BucketGQL"; - lowerBound: Scalars["Float"]["output"]; - rangeKey: Scalars["String"]["output"]; + __typename?: 'BucketGQL'; + lowerBound: Scalars['Float']['output']; + rangeKey: Scalars['String']['output']; }; export type BucketInputGql = { - lowerBound: Scalars["Float"]["input"]; - rangeKey: Scalars["String"]["input"]; + lowerBound: Scalars['Float']['input']; + rangeKey: Scalars['String']['input']; }; export type BucketSetGql = { - __typename?: "BucketSetGQL"; + __typename?: 'BucketSetGQL'; buckets: Array; - feature: Scalars["String"]["output"]; - keyName: Scalars["String"]["output"]; + feature: Scalars['String']['output']; + keyName: Scalars['String']['output']; }; export type BucketSetInputGql = { buckets: Array; - feature: Scalars["String"]["input"]; + feature: Scalars['String']['input']; }; export type CreateBucketSetInput = { buckets: Array; - feature: Scalars["String"]["input"]; - keyName: Scalars["String"]["input"]; + feature: Scalars['String']['input']; + keyName: Scalars['String']['input']; }; export type CreateUploadStreamReturn = { - __typename?: "CreateUploadStreamReturn"; - videoId: Scalars["Int"]["output"]; + __typename?: 'CreateUploadStreamReturn'; + videoId: Scalars['Int']['output']; }; export type CueBallSpeedInput = { @@ -98,21 +85,21 @@ export type CueObjectDistanceInput = { }; export type CueObjectFeaturesGql = { - __typename?: "CueObjectFeaturesGQL"; - cueBallSpeed?: Maybe; - cueObjectAngle?: Maybe; - cueObjectDistance?: Maybe; + __typename?: 'CueObjectFeaturesGQL'; + cueBallSpeed?: Maybe; + cueObjectAngle?: Maybe; + cueObjectDistance?: Maybe; shotDirection?: Maybe; }; export enum DeviceTypeEnum { - Android = "ANDROID", - Browser = "BROWSER", - Ios = "IOS", + Android = 'ANDROID', + Browser = 'BROWSER', + Ios = 'IOS' } export type EnumFilter = { - equals?: InputMaybe; + equals?: InputMaybe; }; export type FilterInput = { @@ -127,8 +114,8 @@ export type FilterInput = { }; export type GetUploadLinkReturn = { - __typename?: "GetUploadLinkReturn"; - uploadUrl: Scalars["String"]["output"]; + __typename?: 'GetUploadLinkReturn'; + uploadUrl: Scalars['String']['output']; }; export type IntendedPocketTypeInput = { @@ -136,32 +123,36 @@ export type IntendedPocketTypeInput = { }; export type Mutation = { - __typename?: "Mutation"; + __typename?: 'Mutation'; createBucketSet: BucketSetGql; createUploadStream: CreateUploadStreamReturn; getUploadLink: GetUploadLinkReturn; - terminateUploadStream: Scalars["Boolean"]["output"]; + terminateUploadStream: Scalars['Boolean']['output']; }; + export type MutationCreateBucketSetArgs = { params: CreateBucketSetInput; }; + export type MutationCreateUploadStreamArgs = { uploadMetadata?: InputMaybe; - videoName?: InputMaybe; + videoName?: InputMaybe; }; + export type MutationGetUploadLinkArgs = { - segmentIndex: Scalars["Int"]["input"]; - videoId: Scalars["Int"]["input"]; + segmentIndex: Scalars['Int']['input']; + videoId: Scalars['Int']['input']; }; + export type MutationTerminateUploadStreamArgs = { - gameType?: InputMaybe; - tableSize?: InputMaybe; - videoId: Scalars["Int"]["input"]; - videoName?: InputMaybe; + gameType?: InputMaybe; + tableSize?: InputMaybe; + videoId: Scalars['Int']['input']; + videoName?: InputMaybe; }; export type OrFilter = { @@ -169,25 +160,25 @@ export type OrFilter = { }; export type PageInfoGql = { - __typename?: "PageInfoGQL"; - endCursor?: Maybe; - hasNextPage: Scalars["Boolean"]["output"]; + __typename?: 'PageInfoGQL'; + endCursor?: Maybe; + hasNextPage: Scalars['Boolean']['output']; }; export enum PocketEnum { - Corner = "CORNER", - Side = "SIDE", + Corner = 'CORNER', + Side = 'SIDE' } export type PocketingIntentionFeaturesGql = { - __typename?: "PocketingIntentionFeaturesGQL"; + __typename?: 'PocketingIntentionFeaturesGQL'; intendedPocketType?: Maybe; - make?: Maybe; - targetPocketDistance?: Maybe; + make?: Maybe; + targetPocketDistance?: Maybe; }; export type Query = { - __typename?: "Query"; + __typename?: 'Query'; getAggregateShots: Array; getBucketSet?: Maybe; getLoggedInUser?: Maybe; @@ -197,40 +188,46 @@ export type Query = { getVideoFeedForUser: VideoFeedGql; }; + export type QueryGetAggregateShotsArgs = { bucketSets: Array; }; + export type QueryGetBucketSetArgs = { - keyName: Scalars["String"]["input"]; + keyName: Scalars['String']['input']; }; + export type QueryGetShotsArgs = { filterInput?: InputMaybe; }; + export type QueryGetUserArgs = { - userId: Scalars["Int"]["input"]; + userId: Scalars['Int']['input']; }; + export type QueryGetVideoArgs = { - videoId: Scalars["Int"]["input"]; + videoId: Scalars['Int']['input']; }; + export type QueryGetVideoFeedForUserArgs = { - after?: InputMaybe; - first?: Scalars["Int"]["input"]; + after?: InputMaybe; + limit?: Scalars['Int']['input']; }; export type RangeFilter = { - greaterThanEqualTo?: InputMaybe; - lessThan?: InputMaybe; + greaterThanEqualTo?: InputMaybe; + lessThan?: InputMaybe; }; export enum ShotDirectionEnum { - Left = "LEFT", - Right = "RIGHT", - Straight = "STRAIGHT", + Left = 'LEFT', + Right = 'RIGHT', + Straight = 'STRAIGHT' } export type ShotDirectionInput = { @@ -238,41 +235,41 @@ export type ShotDirectionInput = { }; export type ShotFeaturesGql = { - __typename?: "ShotFeaturesGQL"; + __typename?: 'ShotFeaturesGQL'; bank?: Maybe; - cueBallSpeed?: Maybe; - cueObjectAngle?: Maybe; - cueObjectDistance?: Maybe; + cueBallSpeed?: Maybe; + cueObjectAngle?: Maybe; + cueObjectDistance?: Maybe; intendedPocket?: Maybe; shotDirection?: Maybe; - targetPocketDistance?: Maybe; + targetPocketDistance?: Maybe; }; export type ShotGql = { - __typename?: "ShotGQL"; - createdAt?: Maybe; + __typename?: 'ShotGQL'; + createdAt?: Maybe; cueObjectFeatures?: Maybe; - endFrame?: Maybe; + endFrame?: Maybe; features?: Maybe; - id?: Maybe; + id?: Maybe; pocketingIntentionFeatures?: Maybe; - startFrame?: Maybe; - updatedAt?: Maybe; - videoId?: Maybe; + startFrame?: Maybe; + updatedAt?: Maybe; + videoId?: Maybe; }; export type TargetFloatFeatureGql = { - __typename?: "TargetFloatFeatureGQL"; - average?: Maybe; - featureName: Scalars["String"]["output"]; - median?: Maybe; + __typename?: 'TargetFloatFeatureGQL'; + average?: Maybe; + featureName: Scalars['String']['output']; + median?: Maybe; }; export type TargetMetricGql = { - __typename?: "TargetMetricGQL"; - count?: Maybe; + __typename?: 'TargetMetricGQL'; + count?: Maybe; floatFeature?: Maybe; - makePercentage?: Maybe; + makePercentage?: Maybe; }; export type TargetPocketDistanceInput = { @@ -280,267 +277,174 @@ export type TargetPocketDistanceInput = { }; export type UploadMetadataInput = { - appVersion?: InputMaybe; - browserName?: InputMaybe; - browserVersion?: InputMaybe; + appVersion?: InputMaybe; + browserName?: InputMaybe; + browserVersion?: InputMaybe; deviceType?: InputMaybe; - ipAddress?: InputMaybe; - locale?: InputMaybe; - networkType?: InputMaybe; - osVersion?: InputMaybe; - timezone?: InputMaybe; + ipAddress?: InputMaybe; + locale?: InputMaybe; + networkType?: InputMaybe; + osVersion?: InputMaybe; + timezone?: InputMaybe; }; export type UploadStreamGql = { - __typename?: "UploadStreamGQL"; - createdAt: Scalars["DateTime"]["output"]; - id: Scalars["ID"]["output"]; - isCompleted: Scalars["Boolean"]["output"]; - linksRequested: Scalars["Int"]["output"]; - updatedAt: Scalars["DateTime"]["output"]; + __typename?: 'UploadStreamGQL'; + createdAt: Scalars['DateTime']['output']; + id: Scalars['ID']['output']; + isCompleted: Scalars['Boolean']['output']; + linksRequested: Scalars['Int']['output']; + updatedAt: Scalars['DateTime']['output']; uploadMetadata: UploadStreamMetadata; - uploadsCompleted: Scalars["Int"]["output"]; + uploadsCompleted: Scalars['Int']['output']; }; export type UploadStreamMetadata = { - __typename?: "UploadStreamMetadata"; - appVersion?: Maybe; - browserName?: Maybe; - browserVersion?: Maybe; + __typename?: 'UploadStreamMetadata'; + appVersion?: Maybe; + browserName?: Maybe; + browserVersion?: Maybe; deviceType?: Maybe; - ipAddress?: Maybe; - locale?: Maybe; - networkType?: Maybe; - osVersion?: Maybe; - timezone?: Maybe; + ipAddress?: Maybe; + locale?: Maybe; + networkType?: Maybe; + osVersion?: Maybe; + timezone?: Maybe; }; export type UserGql = { - __typename?: "UserGQL"; - createdAt?: Maybe; - firebaseUid: Scalars["String"]["output"]; - id: Scalars["Int"]["output"]; + __typename?: 'UserGQL'; + createdAt?: Maybe; + firebaseUid: Scalars['String']['output']; + id: Scalars['Int']['output']; statistics: UserStatisticsGql; - updatedAt?: Maybe; - username: Scalars["String"]["output"]; + updatedAt?: Maybe; + username: Scalars['String']['output']; }; export type UserStatisticsGql = { - __typename?: "UserStatisticsGQL"; - averageTimeBetweenShots: Scalars["Decimal"]["output"]; - makePercentage: Scalars["Decimal"]["output"]; - medianRun?: Maybe; - timeSpentPlaying: Scalars["Decimal"]["output"]; - totalShots: Scalars["Int"]["output"]; - totalShotsMade: Scalars["Int"]["output"]; + __typename?: 'UserStatisticsGQL'; + averageTimeBetweenShots: Scalars['Decimal']['output']; + makePercentage: Scalars['Decimal']['output']; + medianRun?: Maybe; + timeSpentPlaying: Scalars['Decimal']['output']; + totalShots: Scalars['Int']['output']; + totalShotsMade: Scalars['Int']['output']; }; export type VideoFeedGql = { - __typename?: "VideoFeedGQL"; + __typename?: 'VideoFeedGQL'; pageInfo: PageInfoGql; videos: Array; }; export type VideoGql = { - __typename?: "VideoGQL"; - averageTimeBetweenShots?: Maybe; - createdAt?: Maybe; - elapsedTime?: Maybe; - endTime?: Maybe; - framesPerSecond: Scalars["Int"]["output"]; - id: Scalars["Int"]["output"]; - makePercentage: Scalars["Float"]["output"]; - medianRun?: Maybe; - name?: Maybe; + __typename?: 'VideoGQL'; + averageTimeBetweenShots?: Maybe; + createdAt?: Maybe; + elapsedTime?: Maybe; + endTime?: Maybe; + framesPerSecond: Scalars['Int']['output']; + id: Scalars['Int']['output']; + makePercentage: Scalars['Float']['output']; + medianRun?: Maybe; + name?: Maybe; shots: Array; - startTime?: Maybe; + startTime?: Maybe; stream?: Maybe; - totalShots: Scalars["Int"]["output"]; - totalShotsMade: Scalars["Int"]["output"]; - updatedAt?: Maybe; + totalShots: Scalars['Int']['output']; + totalShotsMade: Scalars['Int']['output']; + updatedAt?: Maybe; }; export enum WallTypeEnum { - Long = "LONG", - Short = "SHORT", + Long = 'LONG', + Short = 'SHORT' } export type GetAggregateShotsQueryVariables = Exact<{ bucketSets: Array | 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 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; + limit?: Scalars['Int']['input']; + after?: InputMaybe; }>; -export type GetFeedQuery = { - __typename?: "Query"; - getVideoFeedForUser: { - __typename?: "VideoFeedGQL"; - videos: Array<{ - __typename?: "VideoGQL"; - id: number; - name?: string | null; - totalShotsMade: number; - totalShots: number; - makePercentage: number; - medianRun?: number | null; - averageTimeBetweenShots?: number | null; - createdAt?: any | null; - updatedAt?: any | null; - startTime?: any | null; - endTime?: any | null; - 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 GetFeedQuery = { __typename?: 'Query', getVideoFeedForUser: { __typename?: 'VideoFeedGQL', videos: Array<{ __typename?: 'VideoGQL', id: number, name?: string | null, totalShotsMade: number, totalShots: number, makePercentage: number, medianRun?: number | null, averageTimeBetweenShots?: number | null, createdAt?: any | null, updatedAt?: any | null, startTime?: any | null, endTime?: any | null, 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; - 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"]; + 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 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"]; + videoName: Scalars['String']['input']; deviceType?: InputMaybe; - osVersion?: InputMaybe; - appVersion?: InputMaybe; - browserName?: InputMaybe; - browserVersion?: InputMaybe; - locale?: InputMaybe; - timezone?: InputMaybe; - networkType?: InputMaybe; - ipAddress?: InputMaybe; + osVersion?: InputMaybe; + appVersion?: InputMaybe; + browserName?: InputMaybe; + browserVersion?: InputMaybe; + locale?: InputMaybe; + timezone?: InputMaybe; + networkType?: InputMaybe; + ipAddress?: InputMaybe; }>; -export type CreateUploadStreamMutation = { - __typename?: "Mutation"; - createUploadStream: { - __typename?: "CreateUploadStreamReturn"; - videoId: number; - }; -}; + +export type CreateUploadStreamMutation = { __typename?: 'Mutation', createUploadStream: { __typename?: 'CreateUploadStreamReturn', videoId: number } }; export type GetUploadLinkMutationVariables = Exact<{ - videoId: Scalars["Int"]["input"]; - segmentIndex: Scalars["Int"]["input"]; + videoId: Scalars['Int']['input']; + segmentIndex: Scalars['Int']['input']; }>; -export type GetUploadLinkMutation = { - __typename?: "Mutation"; - getUploadLink: { __typename?: "GetUploadLinkReturn"; uploadUrl: string }; -}; + +export type GetUploadLinkMutation = { __typename?: 'Mutation', getUploadLink: { __typename?: 'GetUploadLinkReturn', uploadUrl: string } }; export type TerminateUploadStreamMutationVariables = Exact<{ - videoId: Scalars["Int"]["input"]; - videoName?: InputMaybe; - gameType?: InputMaybe; - tableSize?: InputMaybe; + videoId: Scalars['Int']['input']; + videoName?: InputMaybe; + gameType?: InputMaybe; + tableSize?: InputMaybe; }>; -export type TerminateUploadStreamMutation = { - __typename?: "Mutation"; - terminateUploadStream: boolean; -}; + +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 - } + query GetAggregateShots($bucketSets: [BucketSetInputGQL!]!) { + getAggregateShots(bucketSets: $bucketSets) { + featureBuckets { + rangeKey + lowerBound + } + targetMetrics { + count + makePercentage + floatFeature { + featureName + average + median } } } -`; +} + `; /** * __useGetAggregateShotsQuery__ @@ -558,95 +462,62 @@ export const GetAggregateShotsDocument = gql` * }, * }); */ -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 function useGetAggregateShotsQuery(baseOptions: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetAggregateShotsDocument, options); + } +export function useGetAggregateShotsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetAggregateShotsDocument, options); + } +export function useGetAggregateShotsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(GetAggregateShotsDocument, options); + } +export type GetAggregateShotsQueryHookResult = ReturnType; +export type GetAggregateShotsLazyQueryHookResult = ReturnType; +export type GetAggregateShotsSuspenseQueryHookResult = ReturnType; +export type GetAggregateShotsQueryResult = Apollo.QueryResult; export const GetFeedDocument = gql` - query GetFeed($first: Int! = 5, $after: String = null) { - getVideoFeedForUser(first: $first, after: $after) { - videos { + query GetFeed($limit: Int! = 5, $after: String = null) { + getVideoFeedForUser(limit: $limit, after: $after) { + videos { + id + name + totalShotsMade + totalShots + makePercentage + medianRun + averageTimeBetweenShots + createdAt + updatedAt + shots { id - name - totalShotsMade - totalShots - makePercentage - medianRun - averageTimeBetweenShots + videoId + startFrame + endFrame createdAt updatedAt - shots { - id - videoId - startFrame - endFrame - createdAt - updatedAt - } - startTime - endTime - elapsedTime - stream { - id - linksRequested - uploadsCompleted - isCompleted - createdAt - updatedAt - } } - pageInfo { - hasNextPage - endCursor + startTime + endTime + elapsedTime + stream { + id + linksRequested + uploadsCompleted + isCompleted + createdAt + updatedAt } } + pageInfo { + hasNextPage + endCursor + } } -`; +} + `; /** * __useGetFeedQuery__ @@ -660,85 +531,50 @@ export const GetFeedDocument = gql` * @example * const { data, loading, error } = useGetFeedQuery({ * variables: { - * first: // value for 'first' + * limit: // value for 'limit' * after: // value for 'after' * }, * }); */ -export function useGetFeedQuery( - baseOptions?: Apollo.QueryHookOptions, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useQuery( - GetFeedDocument, - options, - ); -} -export function useGetFeedLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - GetFeedQuery, - GetFeedQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useLazyQuery( - GetFeedDocument, - options, - ); -} -export function useGetFeedSuspenseQuery( - baseOptions?: Apollo.SuspenseQueryHookOptions< - GetFeedQuery, - GetFeedQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery( - GetFeedDocument, - options, - ); -} +export function useGetFeedQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetFeedDocument, options); + } +export function useGetFeedLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetFeedDocument, options); + } +export function useGetFeedSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(GetFeedDocument, options); + } export type GetFeedQueryHookResult = ReturnType; export type GetFeedLazyQueryHookResult = ReturnType; -export type GetFeedSuspenseQueryHookResult = ReturnType< - typeof useGetFeedSuspenseQuery ->; -export type GetFeedQueryResult = Apollo.QueryResult< - GetFeedQuery, - GetFeedQueryVariables ->; +export type GetFeedSuspenseQueryHookResult = ReturnType; +export type GetFeedQueryResult = Apollo.QueryResult; 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) - } + 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__ @@ -763,85 +599,33 @@ export const GetShotsDocument = gql` * }, * }); */ -export function useGetShotsQuery( - baseOptions?: Apollo.QueryHookOptions, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useQuery( - GetShotsDocument, - options, - ); -} -export function useGetShotsLazyQuery( - baseOptions?: Apollo.LazyQueryHookOptions< - GetShotsQuery, - GetShotsQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useLazyQuery( - GetShotsDocument, - options, - ); -} -export function useGetShotsSuspenseQuery( - baseOptions?: Apollo.SuspenseQueryHookOptions< - GetShotsQuery, - GetShotsQueryVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery( - GetShotsDocument, - options, - ); -} -export type GetShotsQueryHookResult = ReturnType; -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( - videoName: $videoName - uploadMetadata: { - deviceType: $deviceType - osVersion: $osVersion - appVersion: $appVersion - browserName: $browserName - browserVersion: $browserVersion - locale: $locale - timezone: $timezone - networkType: $networkType - ipAddress: $ipAddress +export function useGetShotsQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetShotsDocument, options); } - ) { - videoId - } +export function useGetShotsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetShotsDocument, options); + } +export function useGetShotsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(GetShotsDocument, options); + } +export type GetShotsQueryHookResult = ReturnType; +export type GetShotsLazyQueryHookResult = ReturnType; +export type GetShotsSuspenseQueryHookResult = ReturnType; +export type GetShotsQueryResult = Apollo.QueryResult; +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( + videoName: $videoName + uploadMetadata: {deviceType: $deviceType, osVersion: $osVersion, appVersion: $appVersion, browserName: $browserName, browserVersion: $browserVersion, locale: $locale, timezone: $timezone, networkType: $networkType, ipAddress: $ipAddress} + ) { + videoId } -`; -export type CreateUploadStreamMutationFn = Apollo.MutationFunction< - CreateUploadStreamMutation, - CreateUploadStreamMutationVariables ->; +} + `; +export type CreateUploadStreamMutationFn = Apollo.MutationFunction; /** * __useCreateUploadStreamMutation__ @@ -869,38 +653,21 @@ export type CreateUploadStreamMutationFn = Apollo.MutationFunction< * }, * }); */ -export function useCreateUploadStreamMutation( - baseOptions?: Apollo.MutationHookOptions< - CreateUploadStreamMutation, - CreateUploadStreamMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useMutation< - CreateUploadStreamMutation, - CreateUploadStreamMutationVariables - >(CreateUploadStreamDocument, options); -} -export type CreateUploadStreamMutationHookResult = ReturnType< - typeof useCreateUploadStreamMutation ->; -export type CreateUploadStreamMutationResult = - Apollo.MutationResult; -export type CreateUploadStreamMutationOptions = Apollo.BaseMutationOptions< - CreateUploadStreamMutation, - CreateUploadStreamMutationVariables ->; +export function useCreateUploadStreamMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CreateUploadStreamDocument, options); + } +export type CreateUploadStreamMutationHookResult = ReturnType; +export type CreateUploadStreamMutationResult = Apollo.MutationResult; +export type CreateUploadStreamMutationOptions = Apollo.BaseMutationOptions; export const GetUploadLinkDocument = gql` - mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) { - getUploadLink(videoId: $videoId, segmentIndex: $segmentIndex) { - uploadUrl - } + mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) { + getUploadLink(videoId: $videoId, segmentIndex: $segmentIndex) { + uploadUrl } -`; -export type GetUploadLinkMutationFn = Apollo.MutationFunction< - GetUploadLinkMutation, - GetUploadLinkMutationVariables ->; +} + `; +export type GetUploadLinkMutationFn = Apollo.MutationFunction; /** * __useGetUploadLinkMutation__ @@ -920,46 +687,24 @@ export type GetUploadLinkMutationFn = Apollo.MutationFunction< * }, * }); */ -export function useGetUploadLinkMutation( - baseOptions?: Apollo.MutationHookOptions< - GetUploadLinkMutation, - GetUploadLinkMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useMutation< - GetUploadLinkMutation, - GetUploadLinkMutationVariables - >(GetUploadLinkDocument, options); -} -export type GetUploadLinkMutationHookResult = ReturnType< - typeof useGetUploadLinkMutation ->; -export type GetUploadLinkMutationResult = - Apollo.MutationResult; -export type GetUploadLinkMutationOptions = Apollo.BaseMutationOptions< - GetUploadLinkMutation, - GetUploadLinkMutationVariables ->; +export function useGetUploadLinkMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(GetUploadLinkDocument, options); + } +export type GetUploadLinkMutationHookResult = ReturnType; +export type GetUploadLinkMutationResult = Apollo.MutationResult; +export type GetUploadLinkMutationOptions = Apollo.BaseMutationOptions; export const TerminateUploadStreamDocument = gql` - 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 ->; + mutation TerminateUploadStream($videoId: Int!, $videoName: String, $gameType: String, $tableSize: String) { + terminateUploadStream( + videoId: $videoId + videoName: $videoName + gameType: $gameType + tableSize: $tableSize + ) +} + `; +export type TerminateUploadStreamMutationFn = Apollo.MutationFunction; /** * __useTerminateUploadStreamMutation__ @@ -981,24 +726,10 @@ export type TerminateUploadStreamMutationFn = Apollo.MutationFunction< * }, * }); */ -export function useTerminateUploadStreamMutation( - baseOptions?: Apollo.MutationHookOptions< - TerminateUploadStreamMutation, - TerminateUploadStreamMutationVariables - >, -) { - const options = { ...defaultOptions, ...baseOptions }; - return Apollo.useMutation< - TerminateUploadStreamMutation, - TerminateUploadStreamMutationVariables - >(TerminateUploadStreamDocument, options); -} -export type TerminateUploadStreamMutationHookResult = ReturnType< - typeof useTerminateUploadStreamMutation ->; -export type TerminateUploadStreamMutationResult = - Apollo.MutationResult; -export type TerminateUploadStreamMutationOptions = Apollo.BaseMutationOptions< - TerminateUploadStreamMutation, - TerminateUploadStreamMutationVariables ->; +export function useTerminateUploadStreamMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(TerminateUploadStreamDocument, options); + } +export type TerminateUploadStreamMutationHookResult = ReturnType; +export type TerminateUploadStreamMutationResult = Apollo.MutationResult; +export type TerminateUploadStreamMutationOptions = Apollo.BaseMutationOptions; \ No newline at end of file diff --git a/src/operations/feed.gql b/src/operations/feed.gql index dcfb3ad..e1bb6a9 100644 --- a/src/operations/feed.gql +++ b/src/operations/feed.gql @@ -1,5 +1,5 @@ -query GetFeed($first: Int! = 5, $after: String = null) { - getVideoFeedForUser(first: $first, after: $after) { +query GetFeed($limit: Int! = 5, $after: String = null) { + getVideoFeedForUser(limit: $limit, after: $after) { videos { id name diff --git a/src/schema.gql b/src/schema.gql index c7deb81..61afcb6 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -5,7 +5,7 @@ type Query { getVideo(videoId: Int!): VideoGQL! getShots(filterInput: FilterInput = null): [ShotGQL!]! getBucketSet(keyName: String!): BucketSetGQL - getVideoFeedForUser(first: Int! = 5, after: String = null): VideoFeedGQL! + getVideoFeedForUser(limit: Int! = 5, after: String = null): VideoFeedGQL! } type AggregateResultGQL { @@ -49,9 +49,7 @@ type UserGQL { statistics: UserStatisticsGQL! } -""" -Date with time (isoformat) -""" +"""Date with time (isoformat)""" scalar DateTime type UserStatisticsGQL { @@ -63,9 +61,7 @@ type UserStatisticsGQL { medianRun: Decimal } -""" -Decimal (fixed-point) -""" +"""Decimal (fixed-point)""" scalar Decimal type VideoGQL { @@ -241,17 +237,9 @@ type PageInfoGQL { type Mutation { createBucketSet(params: CreateBucketSetInput!): BucketSetGQL! - createUploadStream( - uploadMetadata: UploadMetadataInput - videoName: String = null - ): CreateUploadStreamReturn! + createUploadStream(uploadMetadata: UploadMetadataInput, videoName: String = null): CreateUploadStreamReturn! getUploadLink(videoId: Int!, segmentIndex: Int!): GetUploadLinkReturn! - terminateUploadStream( - videoId: Int! - videoName: String = null - gameType: String = null - tableSize: String = null - ): Boolean! + terminateUploadStream(videoId: Int!, videoName: String = null, gameType: String = null, tableSize: String = null): Boolean! } input CreateBucketSetInput {