From 31fb95e3b093abc630cb7af3b9442edbb0f44b33 Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Wed, 2 Oct 2024 18:15:00 -0600 Subject: [PATCH] Use ShotWithAllFeatures in getAllShots --- src/index.tsx | 189 +++++++++++++++------------------------ src/operations/shots.gql | 77 ++++------------ 2 files changed, 87 insertions(+), 179 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 65d3841..9c9801c 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2254,18 +2254,6 @@ export type GetShotsWithMetadataQueryVariables = Exact<{ filterInput: FilterInput; shotsPagination?: InputMaybe; limit?: InputMaybe; - includeCreatedAt?: Scalars["Boolean"]["input"]; - includeUpdatedAt?: Scalars["Boolean"]["input"]; - includeCueObjectFeatures?: Scalars["Boolean"]["input"]; - includePocketingIntentionFeatures?: Scalars["Boolean"]["input"]; - includeCueObjectDistance?: Scalars["Boolean"]["input"]; - includeCueObjectAngle?: Scalars["Boolean"]["input"]; - includeCueBallSpeed?: Scalars["Boolean"]["input"]; - includeSpinType?: Scalars["Boolean"]["input"]; - includeShotDirection?: Scalars["Boolean"]["input"]; - includeTargetPocketDistance?: Scalars["Boolean"]["input"]; - includeMake?: Scalars["Boolean"]["input"]; - includeIntendedPocketType?: Scalars["Boolean"]["input"]; }>; export type GetShotsWithMetadataQuery = { @@ -2322,44 +2310,6 @@ export type GetShotsWithMetadataQuery = { }; }; -export type ShotWithAllFeaturesFragment = { - __typename?: "ShotGQL"; - id: number; - videoId: number; - startFrame: number; - endFrame: number; - falsePositiveScore?: number | null; - createdAt?: any | null; - updatedAt?: any | null; - user?: { __typename?: "UserGQL"; id: number } | null; - video?: { - __typename?: "VideoGQL"; - id: number; - stream?: { - __typename?: "UploadStreamGQL"; - resolution: { - __typename?: "VideoResolutionGQL"; - width?: number | null; - height?: number | null; - }; - } | null; - } | null; - cueObjectFeatures?: { - __typename?: "CueObjectFeaturesGQL"; - cueObjectDistance?: number | null; - cueObjectAngle?: number | null; - cueBallSpeed?: number | null; - shotDirection?: ShotDirectionEnum | null; - spinType?: SpinTypeEnum | null; - } | null; - pocketingIntentionFeatures?: { - __typename?: "PocketingIntentionFeaturesGQL"; - targetPocketDistance?: number | null; - make?: boolean | null; - intendedPocketType?: PocketEnum | null; - } | null; -}; - export type GetShotsByIdsQueryVariables = Exact<{ ids: Array | Scalars["Int"]["input"]; }>; @@ -2378,7 +2328,6 @@ export type GetShotsByIdsQuery = { user?: { __typename?: "UserGQL"; id: number } | null; video?: { __typename?: "VideoGQL"; - id: number; stream?: { __typename?: "UploadStreamGQL"; resolution: { @@ -2402,9 +2351,66 @@ export type GetShotsByIdsQuery = { make?: boolean | null; intendedPocketType?: PocketEnum | null; } | null; + pocketingIntentionInfo?: { + __typename?: "PocketingIntentionInfoGQL"; + ballId: number; + pocketId: PocketIdentifier; + pathMetadataIndex: number; + } | null; + serializedShotPaths?: { + __typename?: "SerializedShotPathsGQL"; + b64EncodedBuffer?: string | null; + } | null; }>; }; +export type ShotWithAllFeaturesFragment = { + __typename?: "ShotGQL"; + id: number; + videoId: number; + startFrame: number; + endFrame: number; + falsePositiveScore?: number | null; + createdAt?: any | null; + updatedAt?: any | null; + user?: { __typename?: "UserGQL"; id: number } | null; + video?: { + __typename?: "VideoGQL"; + stream?: { + __typename?: "UploadStreamGQL"; + resolution: { + __typename?: "VideoResolutionGQL"; + width?: number | null; + height?: number | null; + }; + } | null; + } | null; + cueObjectFeatures?: { + __typename?: "CueObjectFeaturesGQL"; + cueObjectDistance?: number | null; + cueObjectAngle?: number | null; + cueBallSpeed?: number | null; + shotDirection?: ShotDirectionEnum | null; + spinType?: SpinTypeEnum | null; + } | null; + pocketingIntentionFeatures?: { + __typename?: "PocketingIntentionFeaturesGQL"; + targetPocketDistance?: number | null; + make?: boolean | null; + intendedPocketType?: PocketEnum | null; + } | null; + pocketingIntentionInfo?: { + __typename?: "PocketingIntentionInfoGQL"; + ballId: number; + pocketId: PocketIdentifier; + pathMetadataIndex: number; + } | null; + serializedShotPaths?: { + __typename?: "SerializedShotPathsGQL"; + b64EncodedBuffer?: string | null; + } | null; +}; + export type GetProfileImageUploadLinkMutationVariables = Exact<{ fileExt?: InputMaybe; }>; @@ -2954,14 +2960,11 @@ export const ShotWithAllFeaturesFragmentDoc = gql` videoId startFrame endFrame - falsePositiveScore - createdAt - updatedAt user { id } + falsePositiveScore video { - id stream { resolution { width @@ -2969,6 +2972,8 @@ export const ShotWithAllFeaturesFragmentDoc = gql` } } } + createdAt + updatedAt cueObjectFeatures { cueObjectDistance cueObjectAngle @@ -2981,6 +2986,14 @@ export const ShotWithAllFeaturesFragmentDoc = gql` make intendedPocketType } + pocketingIntentionInfo { + ballId + pocketId + pathMetadataIndex + } + serializedShotPaths { + b64EncodedBuffer + } } `; export const GetAggregatedShotMetricsDocument = gql` @@ -3479,18 +3492,6 @@ export const GetShotsWithMetadataDocument = gql` $filterInput: FilterInput! $shotsPagination: GetShotsPagination $limit: Int - $includeCreatedAt: Boolean! = false - $includeUpdatedAt: Boolean! = false - $includeCueObjectFeatures: Boolean! = false - $includePocketingIntentionFeatures: Boolean! = false - $includeCueObjectDistance: Boolean! = false - $includeCueObjectAngle: Boolean! = false - $includeCueBallSpeed: Boolean! = false - $includeSpinType: Boolean! = false - $includeShotDirection: Boolean! = false - $includeTargetPocketDistance: Boolean! = false - $includeMake: Boolean! = false - $includeIntendedPocketType: Boolean! = false ) { getShotsWithMetadata( filterInput: $filterInput @@ -3499,49 +3500,11 @@ export const GetShotsWithMetadataDocument = gql` ) { count shots { - id - videoId - startFrame - endFrame - user { - id - } - falsePositiveScore - video { - stream { - resolution { - width - height - } - } - } - createdAt @include(if: $includeCreatedAt) - updatedAt @include(if: $includeUpdatedAt) - cueObjectFeatures @include(if: $includeCueObjectFeatures) { - cueObjectDistance @include(if: $includeCueObjectDistance) - cueObjectAngle @include(if: $includeCueObjectAngle) - cueBallSpeed @include(if: $includeCueBallSpeed) - shotDirection @include(if: $includeShotDirection) - spinType @include(if: $includeSpinType) - } - pocketingIntentionFeatures - @include(if: $includePocketingIntentionFeatures) { - targetPocketDistance @include(if: $includeTargetPocketDistance) - make @include(if: $includeMake) - intendedPocketType @include(if: $includeIntendedPocketType) - } - pocketingIntentionInfo - @include(if: $includePocketingIntentionFeatures) { - ballId - pocketId - pathMetadataIndex - } - serializedShotPaths @include(if: $includePocketingIntentionFeatures) { - b64EncodedBuffer - } + ...ShotWithAllFeatures } } } + ${ShotWithAllFeaturesFragmentDoc} `; /** @@ -3559,18 +3522,6 @@ export const GetShotsWithMetadataDocument = gql` * filterInput: // value for 'filterInput' * shotsPagination: // value for 'shotsPagination' * limit: // value for 'limit' - * includeCreatedAt: // value for 'includeCreatedAt' - * includeUpdatedAt: // value for 'includeUpdatedAt' - * includeCueObjectFeatures: // value for 'includeCueObjectFeatures' - * includePocketingIntentionFeatures: // value for 'includePocketingIntentionFeatures' - * includeCueObjectDistance: // value for 'includeCueObjectDistance' - * includeCueObjectAngle: // value for 'includeCueObjectAngle' - * includeCueBallSpeed: // value for 'includeCueBallSpeed' - * includeSpinType: // value for 'includeSpinType' - * includeShotDirection: // value for 'includeShotDirection' - * includeTargetPocketDistance: // value for 'includeTargetPocketDistance' - * includeMake: // value for 'includeMake' - * includeIntendedPocketType: // value for 'includeIntendedPocketType' * }, * }); */ diff --git a/src/operations/shots.gql b/src/operations/shots.gql index 8dca102..ca5b1cd 100644 --- a/src/operations/shots.gql +++ b/src/operations/shots.gql @@ -21,18 +21,6 @@ query GetShotsWithMetadata( $filterInput: FilterInput! $shotsPagination: GetShotsPagination $limit: Int - $includeCreatedAt: Boolean! = false - $includeUpdatedAt: Boolean! = false - $includeCueObjectFeatures: Boolean! = false - $includePocketingIntentionFeatures: Boolean! = false - $includeCueObjectDistance: Boolean! = false - $includeCueObjectAngle: Boolean! = false - $includeCueBallSpeed: Boolean! = false - $includeSpinType: Boolean! = false - $includeShotDirection: Boolean! = false - $includeTargetPocketDistance: Boolean! = false - $includeMake: Boolean! = false - $includeIntendedPocketType: Boolean! = false ) { getShotsWithMetadata( filterInput: $filterInput @@ -41,62 +29,27 @@ query GetShotsWithMetadata( ) { count shots { - id - videoId - startFrame - endFrame - user { - id - } - falsePositiveScore - video { - stream { - resolution { - width - height - } - } - } - createdAt @include(if: $includeCreatedAt) - updatedAt @include(if: $includeUpdatedAt) - cueObjectFeatures @include(if: $includeCueObjectFeatures) { - cueObjectDistance @include(if: $includeCueObjectDistance) - cueObjectAngle @include(if: $includeCueObjectAngle) - cueBallSpeed @include(if: $includeCueBallSpeed) - shotDirection @include(if: $includeShotDirection) - spinType @include(if: $includeSpinType) - } - pocketingIntentionFeatures - @include(if: $includePocketingIntentionFeatures) { - targetPocketDistance @include(if: $includeTargetPocketDistance) - make @include(if: $includeMake) - intendedPocketType @include(if: $includeIntendedPocketType) - } - pocketingIntentionInfo @include(if: $includePocketingIntentionFeatures) { - ballId - pocketId - pathMetadataIndex - } - serializedShotPaths @include(if: $includePocketingIntentionFeatures) { - b64EncodedBuffer - } + ...ShotWithAllFeatures } } } +query GetShotsByIds($ids: [Int!]!) { + getShotsByIds(ids: $ids) { + ...ShotWithAllFeatures + } +} + fragment ShotWithAllFeatures on ShotGQL { id videoId startFrame endFrame - falsePositiveScore - createdAt - updatedAt user { id } + falsePositiveScore video { - id stream { resolution { width @@ -104,6 +57,8 @@ fragment ShotWithAllFeatures on ShotGQL { } } } + createdAt + updatedAt cueObjectFeatures { cueObjectDistance cueObjectAngle @@ -116,10 +71,12 @@ fragment ShotWithAllFeatures on ShotGQL { make intendedPocketType } -} - -query GetShotsByIds($ids: [Int!]!) { - getShotsByIds(ids: $ids) { - ...ShotWithAllFeatures + pocketingIntentionInfo { + ballId + pocketId + pathMetadataIndex + } + serializedShotPaths { + b64EncodedBuffer } }