Compare commits

...

4 Commits

Author SHA1 Message Date
301c017d5e Delete unused varibles
All checks were successful
Tests / Tests (pull_request) Successful in 10s
2024-10-01 15:28:12 -06:00
1a4b676635 Create shot fragment
Some checks failed
Tests / Tests (pull_request) Failing after 4s
2024-09-30 17:08:11 -06:00
ce54bef0b4 Merge pull request 'Create get shots by ids operation' (#61) from kat/create-get-shots-by-id into master
Reviewed-on: #61
2024-09-29 22:55:34 -06:00
2699d29d7b Create get shots by ids operation
All checks were successful
Tests / Tests (pull_request) Successful in 16s
2024-09-29 22:53:24 -06:00
2 changed files with 232 additions and 0 deletions

View File

@@ -2380,6 +2380,89 @@ 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"]> | Scalars["Int"]["input"];
}>;
export type GetShotsByIdsQuery = {
__typename?: "Query";
getShotsByIds: 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";
targetPocketDistance?: number | null;
make?: boolean | null;
intendedPocketType?: PocketEnum | null;
} | null;
}>;
};
export type GetProfileImageUploadLinkMutationVariables = Exact<{
fileExt?: InputMaybe<Scalars["String"]["input"]>;
}>;
@@ -2923,6 +3006,41 @@ export type GetUploadStreamsWithDetailsQuery = {
};
};
export const ShotWithAllFeaturesFragmentDoc = gql`
fragment ShotWithAllFeatures on ShotGQL {
id
videoId
startFrame
endFrame
falsePositiveScore
createdAt
updatedAt
user {
id
}
video {
id
stream {
resolution {
width
height
}
}
}
cueObjectFeatures {
cueObjectDistance
cueObjectAngle
cueBallSpeed
shotDirection
spinType
}
pocketingIntentionFeatures {
targetPocketDistance
make
intendedPocketType
}
}
`;
export const GetAggregatedShotMetricsDocument = gql`
query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) {
getAggregatedShotMetrics(aggregateInput: $aggregateInput) {
@@ -3695,6 +3813,80 @@ export type GetShotsWithMetadataQueryResult = Apollo.QueryResult<
GetShotsWithMetadataQuery,
GetShotsWithMetadataQueryVariables
>;
export const GetShotsByIdsDocument = gql`
query GetShotsByIds($ids: [Int!]!) {
getShotsByIds(ids: $ids) {
...ShotWithAllFeatures
}
}
${ShotWithAllFeaturesFragmentDoc}
`;
/**
* __useGetShotsByIdsQuery__
*
* To run a query within a React component, call `useGetShotsByIdsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetShotsByIdsQuery` 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 } = useGetShotsByIdsQuery({
* variables: {
* ids: // value for 'ids'
* },
* });
*/
export function useGetShotsByIdsQuery(
baseOptions: Apollo.QueryHookOptions<
GetShotsByIdsQuery,
GetShotsByIdsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<GetShotsByIdsQuery, GetShotsByIdsQueryVariables>(
GetShotsByIdsDocument,
options,
);
}
export function useGetShotsByIdsLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetShotsByIdsQuery,
GetShotsByIdsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<GetShotsByIdsQuery, GetShotsByIdsQueryVariables>(
GetShotsByIdsDocument,
options,
);
}
export function useGetShotsByIdsSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetShotsByIdsQuery,
GetShotsByIdsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetShotsByIdsQuery,
GetShotsByIdsQueryVariables
>(GetShotsByIdsDocument, options);
}
export type GetShotsByIdsQueryHookResult = ReturnType<
typeof useGetShotsByIdsQuery
>;
export type GetShotsByIdsLazyQueryHookResult = ReturnType<
typeof useGetShotsByIdsLazyQuery
>;
export type GetShotsByIdsSuspenseQueryHookResult = ReturnType<
typeof useGetShotsByIdsSuspenseQuery
>;
export type GetShotsByIdsQueryResult = Apollo.QueryResult<
GetShotsByIdsQuery,
GetShotsByIdsQueryVariables
>;
export const GetProfileImageUploadLinkDocument = gql`
mutation getProfileImageUploadLink($fileExt: String = ".png") {
getProfileImageUploadLink(fileExt: $fileExt) {

View File

@@ -139,3 +139,43 @@ query GetShotsWithMetadata(
}
}
}
fragment ShotWithAllFeatures on ShotGQL {
id
videoId
startFrame
endFrame
falsePositiveScore
createdAt
updatedAt
user {
id
}
video {
id
stream {
resolution {
width
height
}
}
}
cueObjectFeatures {
cueObjectDistance
cueObjectAngle
cueBallSpeed
shotDirection
spinType
}
pocketingIntentionFeatures {
targetPocketDistance
make
intendedPocketType
}
}
query GetShotsByIds($ids: [Int!]!) {
getShotsByIds(ids: $ids) {
...ShotWithAllFeatures
}
}