From 301c017d5e2b88410e776de9ca91bb8185220180 Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Mon, 30 Sep 2024 21:15:27 -0600 Subject: [PATCH] Delete unused varibles --- src/index.tsx | 85 ++++++++++------------------------------ src/operations/shots.gql | 34 ++-------------- 2 files changed, 23 insertions(+), 96 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index f7ab38f..65808fe 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2380,8 +2380,8 @@ export type GetShotsWithMetadataQuery = { }; }; -export type ShotFragmentFragment = { - __typename: "ShotGQL"; +export type ShotWithAllFeaturesFragment = { + __typename?: "ShotGQL"; id: number; videoId: number; startFrame: number; @@ -2389,21 +2389,21 @@ export type ShotFragmentFragment = { falsePositiveScore?: number | null; createdAt?: any | null; updatedAt?: any | null; - user?: { __typename: "UserGQL"; id: number } | null; + user?: { __typename?: "UserGQL"; id: number } | null; video?: { - __typename: "VideoGQL"; + __typename?: "VideoGQL"; id: number; stream?: { - __typename: "UploadStreamGQL"; + __typename?: "UploadStreamGQL"; resolution: { - __typename: "VideoResolutionGQL"; + __typename?: "VideoResolutionGQL"; width?: number | null; height?: number | null; }; } | null; } | null; cueObjectFeatures?: { - __typename: "CueObjectFeaturesGQL"; + __typename?: "CueObjectFeaturesGQL"; cueObjectDistance?: number | null; cueObjectAngle?: number | null; cueBallSpeed?: number | null; @@ -2411,7 +2411,7 @@ export type ShotFragmentFragment = { spinType?: SpinTypeEnum | null; } | null; pocketingIntentionFeatures?: { - __typename: "PocketingIntentionFeaturesGQL"; + __typename?: "PocketingIntentionFeaturesGQL"; targetPocketDistance?: number | null; make?: boolean | null; intendedPocketType?: PocketEnum | null; @@ -2420,24 +2420,12 @@ export type ShotFragmentFragment = { export type GetShotsByIdsQueryVariables = Exact<{ ids: Array | Scalars["Int"]["input"]; - 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 GetShotsByIdsQuery = { __typename?: "Query"; getShotsByIds: Array<{ - __typename: "ShotGQL"; + __typename?: "ShotGQL"; id: number; videoId: number; startFrame: number; @@ -2445,21 +2433,21 @@ export type GetShotsByIdsQuery = { falsePositiveScore?: number | null; createdAt?: any | null; updatedAt?: any | null; - user?: { __typename: "UserGQL"; id: number } | null; + user?: { __typename?: "UserGQL"; id: number } | null; video?: { - __typename: "VideoGQL"; + __typename?: "VideoGQL"; id: number; stream?: { - __typename: "UploadStreamGQL"; + __typename?: "UploadStreamGQL"; resolution: { - __typename: "VideoResolutionGQL"; + __typename?: "VideoResolutionGQL"; width?: number | null; height?: number | null; }; } | null; } | null; cueObjectFeatures?: { - __typename: "CueObjectFeaturesGQL"; + __typename?: "CueObjectFeaturesGQL"; cueObjectDistance?: number | null; cueObjectAngle?: number | null; cueBallSpeed?: number | null; @@ -2467,7 +2455,7 @@ export type GetShotsByIdsQuery = { spinType?: SpinTypeEnum | null; } | null; pocketingIntentionFeatures?: { - __typename: "PocketingIntentionFeaturesGQL"; + __typename?: "PocketingIntentionFeaturesGQL"; targetPocketDistance?: number | null; make?: boolean | null; intendedPocketType?: PocketEnum | null; @@ -3018,9 +3006,8 @@ export type GetUploadStreamsWithDetailsQuery = { }; }; -export const ShotFragmentFragmentDoc = gql` - fragment ShotFragment on ShotGQL { - __typename +export const ShotWithAllFeaturesFragmentDoc = gql` + fragment ShotWithAllFeatures on ShotGQL { id videoId startFrame @@ -3029,23 +3016,18 @@ export const ShotFragmentFragmentDoc = gql` createdAt updatedAt user { - __typename id } video { - __typename id stream { - __typename resolution { - __typename width height } } } cueObjectFeatures { - __typename cueObjectDistance cueObjectAngle cueBallSpeed @@ -3053,7 +3035,6 @@ export const ShotFragmentFragmentDoc = gql` spinType } pocketingIntentionFeatures { - __typename targetPocketDistance make intendedPocketType @@ -3833,26 +3814,12 @@ export type GetShotsWithMetadataQueryResult = Apollo.QueryResult< GetShotsWithMetadataQueryVariables >; export const GetShotsByIdsDocument = gql` - query GetShotsByIds( - $ids: [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 - ) { + query GetShotsByIds($ids: [Int!]!) { getShotsByIds(ids: $ids) { - ...ShotFragment + ...ShotWithAllFeatures } } - ${ShotFragmentFragmentDoc} + ${ShotWithAllFeaturesFragmentDoc} `; /** @@ -3868,18 +3835,6 @@ export const GetShotsByIdsDocument = gql` * const { data, loading, error } = useGetShotsByIdsQuery({ * variables: { * ids: // value for 'ids' - * 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 2349053..c035ac7 100644 --- a/src/operations/shots.gql +++ b/src/operations/shots.gql @@ -139,10 +139,8 @@ query GetShotsWithMetadata( } } } -# shot.gql -fragment ShotFragment on ShotGQL { - __typename +fragment ShotWithAllFeatures on ShotGQL { id videoId startFrame @@ -151,25 +149,18 @@ fragment ShotFragment on ShotGQL { createdAt updatedAt user { - __typename id - # Add other necessary fields from UserGql if needed } video { - __typename id - # Add other necessary fields from VideoGql if needed stream { - __typename resolution { - __typename width height } } } cueObjectFeatures { - __typename cueObjectDistance cueObjectAngle cueBallSpeed @@ -177,33 +168,14 @@ fragment ShotFragment on ShotGQL { spinType } pocketingIntentionFeatures { - __typename targetPocketDistance make intendedPocketType } - # Add other nested fields as required } -query GetShotsByIds( - $ids: [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 -) { +query GetShotsByIds($ids: [Int!]!) { getShotsByIds(ids: $ids) { - ...ShotFragment - # Since the fragment already includes all necessary fields, - # you can remove the conditional fields from the query itself. - # Alternatively, if you still need conditional fields, handle them within the fragment. + ...ShotWithAllFeatures } }