From 722b2ca2b0c9bdaba4f3952bb9ce7dae51f7b65b Mon Sep 17 00:00:00 2001 From: Dean Wenstrand Date: Wed, 22 Jul 2026 22:47:20 -0700 Subject: [PATCH] Re-add legacy shot-sim operations alongside GetShotLabVideos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mobile master's shot-simulation-screen still uses LiveStreamPicker and RecordedShotPicker (GetLiveStreams / GetRecordedStreams) while ALSO using the video-first GetShotLabVideos picker — a transitional state. 1a95439 replaced the old operations in-place, so no gql commit carried the union and mobile master's pointer could not satisfy its own code. live_streams.gql is restored verbatim; GetRecordedStreams is re-added in legacy_shotsim.gql so master's recorded_shots.gql (which now holds GetShotLabVideos) stays untouched. Drop both when the old pickers are deleted. Co-Authored-By: Claude Opus 4.8 --- src/index.tsx | 252 ++++++++++++++++++++++++++++++ src/operations/legacy_shotsim.gql | 25 +++ src/operations/live_streams.gql | 34 ++++ 3 files changed, 311 insertions(+) create mode 100644 src/operations/legacy_shotsim.gql create mode 100644 src/operations/live_streams.gql diff --git a/src/index.tsx b/src/index.tsx index dfec50c..8bd9481 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -5414,6 +5414,69 @@ export type GetMyDrillRunsQuery = { }>; }; +export type GetRecordedStreamsQueryVariables = Exact<{ + limit?: Scalars["Int"]["input"]; +}>; + +export type GetRecordedStreamsQuery = { + __typename?: "Query"; + getFeedVideos: { + __typename?: "VideoHistoryGQL"; + videos: Array<{ + __typename?: "VideoGQL"; + id: number; + name?: string | null; + createdAt?: any | null; + screenshotUri?: string | null; + framesPerSecond?: number | null; + totalShots: number; + owner?: { + __typename?: "UserGQL"; + id: number; + username: string; + profileImageUri?: string | null; + } | null; + }>; + }; +}; + +export type GetLiveStreamsQueryVariables = Exact<{ + limit?: Scalars["Int"]["input"]; +}>; + +export type GetLiveStreamsQuery = { + __typename?: "Query"; + getFeedVideos: { + __typename?: "VideoHistoryGQL"; + videos: Array<{ + __typename?: "VideoGQL"; + id: number; + name?: string | null; + startTime?: any | null; + createdAt?: any | null; + screenshotUri?: string | null; + elapsedTime?: number | null; + owner?: { + __typename?: "UserGQL"; + id: number; + username: string; + profileImageUri?: string | null; + } | null; + stream?: { + __typename?: "UploadStreamGQL"; + id: string; + isCompleted: boolean; + lastSegmentUploadedAt?: any | null; + } | null; + }>; + pageInfo: { + __typename?: "PageInfoGQL"; + hasNextPage: boolean; + endCursor?: string | null; + }; + }; +}; + export type GetVideoMakePercentageIntervalsQueryVariables = Exact<{ videoId: Scalars["ID"]["input"]; intervalDuration: Scalars["Int"]["input"]; @@ -12385,6 +12448,195 @@ export type GetMyDrillRunsQueryResult = Apollo.QueryResult< GetMyDrillRunsQuery, GetMyDrillRunsQueryVariables >; +export const GetRecordedStreamsDocument = gql` + query GetRecordedStreams($limit: Int! = 25) { + getFeedVideos( + limit: $limit + filters: { isStreamCompleted: true, excludeVideosWithNoShots: true } + includePrivate: MINE + feedInput: { allUsers: true } + ) { + videos { + id + name + createdAt + screenshotUri + framesPerSecond + totalShots + owner { + id + username + profileImageUri + } + } + } + } +`; + +/** + * __useGetRecordedStreamsQuery__ + * + * To run a query within a React component, call `useGetRecordedStreamsQuery` and pass it any options that fit your needs. + * When your component renders, `useGetRecordedStreamsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetRecordedStreamsQuery({ + * variables: { + * limit: // value for 'limit' + * }, + * }); + */ +export function useGetRecordedStreamsQuery( + baseOptions?: Apollo.QueryHookOptions< + GetRecordedStreamsQuery, + GetRecordedStreamsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery< + GetRecordedStreamsQuery, + GetRecordedStreamsQueryVariables + >(GetRecordedStreamsDocument, options); +} +export function useGetRecordedStreamsLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GetRecordedStreamsQuery, + GetRecordedStreamsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery< + GetRecordedStreamsQuery, + GetRecordedStreamsQueryVariables + >(GetRecordedStreamsDocument, options); +} +export function useGetRecordedStreamsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + GetRecordedStreamsQuery, + GetRecordedStreamsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + GetRecordedStreamsQuery, + GetRecordedStreamsQueryVariables + >(GetRecordedStreamsDocument, options); +} +export type GetRecordedStreamsQueryHookResult = ReturnType< + typeof useGetRecordedStreamsQuery +>; +export type GetRecordedStreamsLazyQueryHookResult = ReturnType< + typeof useGetRecordedStreamsLazyQuery +>; +export type GetRecordedStreamsSuspenseQueryHookResult = ReturnType< + typeof useGetRecordedStreamsSuspenseQuery +>; +export type GetRecordedStreamsQueryResult = Apollo.QueryResult< + GetRecordedStreamsQuery, + GetRecordedStreamsQueryVariables +>; +export const GetLiveStreamsDocument = gql` + query GetLiveStreams($limit: Int! = 25) { + getFeedVideos( + limit: $limit + filters: { isStreamCompleted: false, requireCursorCompletion: false } + includePrivate: MINE + feedInput: { allUsers: true } + ) { + videos { + id + name + startTime + createdAt + screenshotUri + elapsedTime + owner { + id + username + profileImageUri + } + stream { + id + isCompleted + lastSegmentUploadedAt + } + } + pageInfo { + hasNextPage + endCursor + } + } + } +`; + +/** + * __useGetLiveStreamsQuery__ + * + * To run a query within a React component, call `useGetLiveStreamsQuery` and pass it any options that fit your needs. + * When your component renders, `useGetLiveStreamsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetLiveStreamsQuery({ + * variables: { + * limit: // value for 'limit' + * }, + * }); + */ +export function useGetLiveStreamsQuery( + baseOptions?: Apollo.QueryHookOptions< + GetLiveStreamsQuery, + GetLiveStreamsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + GetLiveStreamsDocument, + options, + ); +} +export function useGetLiveStreamsLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GetLiveStreamsQuery, + GetLiveStreamsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery( + GetLiveStreamsDocument, + options, + ); +} +export function useGetLiveStreamsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + GetLiveStreamsQuery, + GetLiveStreamsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + GetLiveStreamsQuery, + GetLiveStreamsQueryVariables + >(GetLiveStreamsDocument, options); +} +export type GetLiveStreamsQueryHookResult = ReturnType< + typeof useGetLiveStreamsQuery +>; +export type GetLiveStreamsLazyQueryHookResult = ReturnType< + typeof useGetLiveStreamsLazyQuery +>; +export type GetLiveStreamsSuspenseQueryHookResult = ReturnType< + typeof useGetLiveStreamsSuspenseQuery +>; +export type GetLiveStreamsQueryResult = Apollo.QueryResult< + GetLiveStreamsQuery, + GetLiveStreamsQueryVariables +>; export const GetVideoMakePercentageIntervalsDocument = gql` query GetVideoMakePercentageIntervals( $videoId: ID! diff --git a/src/operations/legacy_shotsim.gql b/src/operations/legacy_shotsim.gql new file mode 100644 index 0000000..9adfb9e --- /dev/null +++ b/src/operations/legacy_shotsim.gql @@ -0,0 +1,25 @@ +# Legacy shot-sim operations still used by mobile master's +# LiveStreamPicker / RecordedShotPicker; remove when those are deleted. + +query GetRecordedStreams($limit: Int! = 25) { + getFeedVideos( + limit: $limit + filters: { isStreamCompleted: true, excludeVideosWithNoShots: true } + includePrivate: MINE + feedInput: { allUsers: true } + ) { + videos { + id + name + createdAt + screenshotUri + framesPerSecond + totalShots + owner { + id + username + profileImageUri + } + } + } +} diff --git a/src/operations/live_streams.gql b/src/operations/live_streams.gql new file mode 100644 index 0000000..45e4167 --- /dev/null +++ b/src/operations/live_streams.gql @@ -0,0 +1,34 @@ +# Lightweight listing of live (in-progress) streams for pickers like the +# Shot Lab "follow a live stream" flow. Selects only what a picker card +# needs; intentionally avoids the heavy VideoCardFields fragment. +query GetLiveStreams($limit: Int! = 25) { + getFeedVideos( + limit: $limit + filters: { isStreamCompleted: false, requireCursorCompletion: false } + includePrivate: MINE + feedInput: { allUsers: true } + ) { + videos { + id + name + startTime + createdAt + screenshotUri + elapsedTime + owner { + id + username + profileImageUri + } + stream { + id + isCompleted + lastSegmentUploadedAt + } + } + pageInfo { + hasNextPage + endCursor + } + } +}