Compare commits

..

5 Commits

Author SHA1 Message Date
15be60f2ca Create reserved query for get shots with metadata
All checks were successful
Tests / Tests (pull_request) Successful in 15s
2024-10-11 17:56:30 -06:00
59aaf47cbe Merge pull request 'Add a lightweight GQL call to get video header info' (#73) from loewy/add-lightweight-get-video-with-just-header-info into master
Reviewed-on: #73
2024-10-10 18:33:42 -06:00
c426e753cd add lightweigth gql call to get video header info
All checks were successful
Tests / Tests (pull_request) Successful in 15s
2024-10-10 17:02:18 -07:00
c8cf97421b Merge pull request 'Add id to shots: video items to prevent cache merge issues' (#72) from loewy/add-id-to-fix-cache-merging-issue into master
Reviewed-on: #72
2024-10-07 22:15:38 -06:00
9718137ad3 add id to prevent cache merge issues
All checks were successful
Tests / Tests (pull_request) Successful in 8s
2024-10-07 21:14:47 -07:00
3 changed files with 280 additions and 0 deletions

View File

@@ -2424,6 +2424,72 @@ export type GetShotsWithVideoGqlQuery = {
};
};
export type GetShotsWithMetadataFilterResultQueryVariables = Exact<{
filterInput: FilterInput;
shotsPagination?: InputMaybe<GetShotsPagination>;
limit?: InputMaybe<Scalars["Int"]["input"]>;
ids?: InputMaybe<Array<Scalars["Int"]["input"]> | Scalars["Int"]["input"]>;
}>;
export type GetShotsWithMetadataFilterResultQuery = {
__typename?: "Query";
getShotsWithMetadata: {
__typename?: "GetShotsResult";
count?: number | null;
ids: Array<number>;
shots: Array<{
__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";
make?: boolean | null;
targetPocketDistance?: number | null;
targetPocketAngle?: number | null;
targetPocketAngleDirection?: ShotDirectionEnum | null;
marginOfErrorInDegrees?: number | null;
intendedPocketType?: PocketEnum | null;
} | null;
pocketingIntentionInfo?: {
__typename?: "PocketingIntentionInfoGQL";
ballId: number;
pocketId: PocketIdentifier;
pathMetadataIndex: number;
} | null;
serializedShotPaths?: {
__typename?: "SerializedShotPathsGQL";
b64EncodedBuffer?: string | null;
} | null;
}>;
};
};
export type GetShotsWithMetadataQueryVariables = Exact<{
filterInput: FilterInput;
shotsPagination?: InputMaybe<GetShotsPagination>;
@@ -2449,6 +2515,7 @@ export type GetShotsWithMetadataQuery = {
user?: { __typename?: "UserGQL"; id: number } | null;
video?: {
__typename?: "VideoGQL";
id: number;
stream?: {
__typename?: "UploadStreamGQL";
resolution: {
@@ -2507,6 +2574,7 @@ export type GetShotsByIdsQuery = {
user?: { __typename?: "UserGQL"; id: number } | null;
video?: {
__typename?: "VideoGQL";
id: number;
stream?: {
__typename?: "UploadStreamGQL";
resolution: {
@@ -2558,6 +2626,7 @@ export type ShotWithAllFeaturesFragment = {
user?: { __typename?: "UserGQL"; id: number } | null;
video?: {
__typename?: "VideoGQL";
id: number;
stream?: {
__typename?: "UploadStreamGQL";
resolution: {
@@ -2967,6 +3036,20 @@ export type GetVideoForClipTimesQuery = {
};
};
export type GetHeaderInfoByVideoIdQueryVariables = Exact<{
videoId: Scalars["Int"]["input"];
}>;
export type GetHeaderInfoByVideoIdQuery = {
__typename?: "Query";
getVideo: {
__typename?: "VideoGQL";
id: number;
name?: string | null;
startTime?: any | null;
};
};
export type CreateUploadStreamMutationVariables = Exact<{
videoMetadataInput: VideoMetadataInput;
}>;
@@ -3150,6 +3233,7 @@ export const ShotWithAllFeaturesFragmentDoc = gql`
}
falsePositiveScore
video {
id
stream {
resolution {
width
@@ -3757,6 +3841,96 @@ export type GetShotsWithVideoGqlQueryResult = Apollo.QueryResult<
GetShotsWithVideoGqlQuery,
GetShotsWithVideoGqlQueryVariables
>;
export const GetShotsWithMetadataFilterResultDocument = gql`
query GetShotsWithMetadataFilterResult(
$filterInput: FilterInput!
$shotsPagination: GetShotsPagination
$limit: Int
$ids: [Int!]
) {
getShotsWithMetadata(
filterInput: $filterInput
shotsPagination: $shotsPagination
limit: $limit
ids: $ids
) {
count
shots {
...ShotWithAllFeatures
}
ids
}
}
${ShotWithAllFeaturesFragmentDoc}
`;
/**
* __useGetShotsWithMetadataFilterResultQuery__
*
* To run a query within a React component, call `useGetShotsWithMetadataFilterResultQuery` and pass it any options that fit your needs.
* When your component renders, `useGetShotsWithMetadataFilterResultQuery` 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 } = useGetShotsWithMetadataFilterResultQuery({
* variables: {
* filterInput: // value for 'filterInput'
* shotsPagination: // value for 'shotsPagination'
* limit: // value for 'limit'
* ids: // value for 'ids'
* },
* });
*/
export function useGetShotsWithMetadataFilterResultQuery(
baseOptions: Apollo.QueryHookOptions<
GetShotsWithMetadataFilterResultQuery,
GetShotsWithMetadataFilterResultQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<
GetShotsWithMetadataFilterResultQuery,
GetShotsWithMetadataFilterResultQueryVariables
>(GetShotsWithMetadataFilterResultDocument, options);
}
export function useGetShotsWithMetadataFilterResultLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetShotsWithMetadataFilterResultQuery,
GetShotsWithMetadataFilterResultQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetShotsWithMetadataFilterResultQuery,
GetShotsWithMetadataFilterResultQueryVariables
>(GetShotsWithMetadataFilterResultDocument, options);
}
export function useGetShotsWithMetadataFilterResultSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetShotsWithMetadataFilterResultQuery,
GetShotsWithMetadataFilterResultQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetShotsWithMetadataFilterResultQuery,
GetShotsWithMetadataFilterResultQueryVariables
>(GetShotsWithMetadataFilterResultDocument, options);
}
export type GetShotsWithMetadataFilterResultQueryHookResult = ReturnType<
typeof useGetShotsWithMetadataFilterResultQuery
>;
export type GetShotsWithMetadataFilterResultLazyQueryHookResult = ReturnType<
typeof useGetShotsWithMetadataFilterResultLazyQuery
>;
export type GetShotsWithMetadataFilterResultSuspenseQueryHookResult =
ReturnType<typeof useGetShotsWithMetadataFilterResultSuspenseQuery>;
export type GetShotsWithMetadataFilterResultQueryResult = Apollo.QueryResult<
GetShotsWithMetadataFilterResultQuery,
GetShotsWithMetadataFilterResultQueryVariables
>;
export const GetShotsWithMetadataDocument = gql`
query GetShotsWithMetadata(
$filterInput: FilterInput!
@@ -5223,6 +5397,81 @@ export type GetVideoForClipTimesQueryResult = Apollo.QueryResult<
GetVideoForClipTimesQuery,
GetVideoForClipTimesQueryVariables
>;
export const GetHeaderInfoByVideoIdDocument = gql`
query GetHeaderInfoByVideoId($videoId: Int!) {
getVideo(videoId: $videoId) {
id
name
startTime
}
}
`;
/**
* __useGetHeaderInfoByVideoIdQuery__
*
* To run a query within a React component, call `useGetHeaderInfoByVideoIdQuery` and pass it any options that fit your needs.
* When your component renders, `useGetHeaderInfoByVideoIdQuery` 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 } = useGetHeaderInfoByVideoIdQuery({
* variables: {
* videoId: // value for 'videoId'
* },
* });
*/
export function useGetHeaderInfoByVideoIdQuery(
baseOptions: Apollo.QueryHookOptions<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>(GetHeaderInfoByVideoIdDocument, options);
}
export function useGetHeaderInfoByVideoIdLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>(GetHeaderInfoByVideoIdDocument, options);
}
export function useGetHeaderInfoByVideoIdSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>(GetHeaderInfoByVideoIdDocument, options);
}
export type GetHeaderInfoByVideoIdQueryHookResult = ReturnType<
typeof useGetHeaderInfoByVideoIdQuery
>;
export type GetHeaderInfoByVideoIdLazyQueryHookResult = ReturnType<
typeof useGetHeaderInfoByVideoIdLazyQuery
>;
export type GetHeaderInfoByVideoIdSuspenseQueryHookResult = ReturnType<
typeof useGetHeaderInfoByVideoIdSuspenseQuery
>;
export type GetHeaderInfoByVideoIdQueryResult = Apollo.QueryResult<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>;
export const CreateUploadStreamDocument = gql`
mutation CreateUploadStream($videoMetadataInput: VideoMetadataInput!) {
createUploadStream(videoMetadata: $videoMetadataInput) {

View File

@@ -31,6 +31,28 @@ query GetShotsWithVideoGql($filterInput: FilterInput!, $limit: Int) {
}
}
## Reserved for playlists (which are created from a filter)
query GetShotsWithMetadataFilterResult(
$filterInput: FilterInput!
$shotsPagination: GetShotsPagination
$limit: Int
$ids: [Int!]
) {
getShotsWithMetadata(
filterInput: $filterInput
shotsPagination: $shotsPagination
limit: $limit
ids: $ids
) {
count
shots {
...ShotWithAllFeatures
}
ids
}
}
# TODO: Delete
query GetShotsWithMetadata(
$filterInput: FilterInput!
$shotsPagination: GetShotsPagination
@@ -67,6 +89,7 @@ fragment ShotWithAllFeatures on ShotGQL {
}
falsePositiveScore
video {
id
stream {
resolution {
width

View File

@@ -237,3 +237,11 @@ query GetVideoForClipTimes($videoId: Int!) {
}
}
}
query GetHeaderInfoByVideoId($videoId: Int!) {
getVideo(videoId: $videoId) {
id
name
startTime
}
}