From cd20cfcb40acb4de30c6b57fdd9f18fe67393df1 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 4 Feb 2025 20:57:22 -0700 Subject: [PATCH] Add get runs for highlights --- src/index.tsx | 112 ++++++++++++++++++++++++++++++++++++++++ src/operations/runs.gql | 20 +++++++ 2 files changed, 132 insertions(+) create mode 100644 src/operations/runs.gql diff --git a/src/index.tsx b/src/index.tsx index 7c56755..3008068 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3389,6 +3389,28 @@ export type GetMedalsQuery = { }; }; +export type GetRunsForHighlightsQueryVariables = Exact<{ + filterInput: RunFilterInput; + runIds?: InputMaybe | Scalars["Int"]["input"]>; + runsOrdering?: InputMaybe; +}>; + +export type GetRunsForHighlightsQuery = { + __typename?: "Query"; + getRuns: { + __typename?: "GetRunsResult"; + count?: number | null; + runIds: Array; + runs: Array<{ + __typename?: "RunGQL"; + id: number; + runLength: number; + userId: number; + videoId: number; + }>; + }; +}; + export type GetSerializedShotPathsQueryVariables = Exact<{ filterInput: FilterInput; }>; @@ -5721,6 +5743,96 @@ export type GetMedalsQueryResult = Apollo.QueryResult< GetMedalsQuery, GetMedalsQueryVariables >; +export const GetRunsForHighlightsDocument = gql` + query GetRunsForHighlights( + $filterInput: RunFilterInput! + $runIds: [Int!] = null + $runsOrdering: GetRunsOrdering + ) { + getRuns( + filterInput: $filterInput + runIds: $runIds + runsOrdering: $runsOrdering + ) { + count + runs { + id + runLength + userId + videoId + } + runIds + } + } +`; + +/** + * __useGetRunsForHighlightsQuery__ + * + * To run a query within a React component, call `useGetRunsForHighlightsQuery` and pass it any options that fit your needs. + * When your component renders, `useGetRunsForHighlightsQuery` 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 } = useGetRunsForHighlightsQuery({ + * variables: { + * filterInput: // value for 'filterInput' + * runIds: // value for 'runIds' + * runsOrdering: // value for 'runsOrdering' + * }, + * }); + */ +export function useGetRunsForHighlightsQuery( + baseOptions: Apollo.QueryHookOptions< + GetRunsForHighlightsQuery, + GetRunsForHighlightsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery< + GetRunsForHighlightsQuery, + GetRunsForHighlightsQueryVariables + >(GetRunsForHighlightsDocument, options); +} +export function useGetRunsForHighlightsLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GetRunsForHighlightsQuery, + GetRunsForHighlightsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery< + GetRunsForHighlightsQuery, + GetRunsForHighlightsQueryVariables + >(GetRunsForHighlightsDocument, options); +} +export function useGetRunsForHighlightsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + GetRunsForHighlightsQuery, + GetRunsForHighlightsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + GetRunsForHighlightsQuery, + GetRunsForHighlightsQueryVariables + >(GetRunsForHighlightsDocument, options); +} +export type GetRunsForHighlightsQueryHookResult = ReturnType< + typeof useGetRunsForHighlightsQuery +>; +export type GetRunsForHighlightsLazyQueryHookResult = ReturnType< + typeof useGetRunsForHighlightsLazyQuery +>; +export type GetRunsForHighlightsSuspenseQueryHookResult = ReturnType< + typeof useGetRunsForHighlightsSuspenseQuery +>; +export type GetRunsForHighlightsQueryResult = Apollo.QueryResult< + GetRunsForHighlightsQuery, + GetRunsForHighlightsQueryVariables +>; export const GetSerializedShotPathsDocument = gql` query GetSerializedShotPaths($filterInput: FilterInput!) { getShots(filterInput: $filterInput) { diff --git a/src/operations/runs.gql b/src/operations/runs.gql new file mode 100644 index 0000000..3a2b002 --- /dev/null +++ b/src/operations/runs.gql @@ -0,0 +1,20 @@ +query GetRunsForHighlights( + $filterInput: RunFilterInput! + $runIds: [Int!] = null + $runsOrdering: GetRunsOrdering +) { + getRuns( + filterInput: $filterInput + runIds: $runIds + runsOrdering: $runsOrdering + ) { + count + runs { + id + runLength + userId + videoId + } + runIds + } +}