Add VideoPlayerClusters query + FinalizePlayerAssignments mutation
All checks were successful
Tests / Tests (pull_request) Successful in 10s
All checks were successful
Tests / Tests (pull_request) Successful in 10s
Operation file for the per-video player-labeling UI that consumes the schema types added in #240. - VideoPlayerClusters($videoId): read clusters + crops - FinalizePlayerAssignments($input): apply user assignments and shot moves in one transaction Generated by `just gql`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
242
src/index.tsx
242
src/index.tsx
@@ -4929,6 +4929,96 @@ export type GetRunsWithTimestampsQuery = {
|
||||
};
|
||||
};
|
||||
|
||||
export type PlayerClusterShotFieldsFragment = {
|
||||
__typename?: "PlayerClusterShotGQL";
|
||||
shotId: number;
|
||||
bboxX1: number;
|
||||
bboxY1: number;
|
||||
bboxX2: number;
|
||||
bboxY2: number;
|
||||
confidence: number;
|
||||
isConfirmed: boolean;
|
||||
cropUrl?: string | null;
|
||||
fullFrameUrl?: string | null;
|
||||
};
|
||||
|
||||
export type PlayerClusterFieldsFragment = {
|
||||
__typename?: "PlayerClusterGQL";
|
||||
videoId: number;
|
||||
clusterId: number;
|
||||
nShots: number;
|
||||
userId?: number | null;
|
||||
confirmed: boolean;
|
||||
shots: Array<{
|
||||
__typename?: "PlayerClusterShotGQL";
|
||||
shotId: number;
|
||||
bboxX1: number;
|
||||
bboxY1: number;
|
||||
bboxX2: number;
|
||||
bboxY2: number;
|
||||
confidence: number;
|
||||
isConfirmed: boolean;
|
||||
cropUrl?: string | null;
|
||||
fullFrameUrl?: string | null;
|
||||
}>;
|
||||
};
|
||||
|
||||
export type VideoPlayerClustersQueryVariables = Exact<{
|
||||
videoId: Scalars["Int"]["input"];
|
||||
}>;
|
||||
|
||||
export type VideoPlayerClustersQuery = {
|
||||
__typename?: "Query";
|
||||
videoPlayerClusters: Array<{
|
||||
__typename?: "PlayerClusterGQL";
|
||||
videoId: number;
|
||||
clusterId: number;
|
||||
nShots: number;
|
||||
userId?: number | null;
|
||||
confirmed: boolean;
|
||||
shots: Array<{
|
||||
__typename?: "PlayerClusterShotGQL";
|
||||
shotId: number;
|
||||
bboxX1: number;
|
||||
bboxY1: number;
|
||||
bboxX2: number;
|
||||
bboxY2: number;
|
||||
confidence: number;
|
||||
isConfirmed: boolean;
|
||||
cropUrl?: string | null;
|
||||
fullFrameUrl?: string | null;
|
||||
}>;
|
||||
}>;
|
||||
};
|
||||
|
||||
export type FinalizePlayerAssignmentsMutationVariables = Exact<{
|
||||
input: FinalizePlayerAssignmentsInput;
|
||||
}>;
|
||||
|
||||
export type FinalizePlayerAssignmentsMutation = {
|
||||
__typename?: "Mutation";
|
||||
finalizePlayerAssignments: Array<{
|
||||
__typename?: "PlayerClusterGQL";
|
||||
videoId: number;
|
||||
clusterId: number;
|
||||
nShots: number;
|
||||
userId?: number | null;
|
||||
confirmed: boolean;
|
||||
shots: Array<{
|
||||
__typename?: "PlayerClusterShotGQL";
|
||||
shotId: number;
|
||||
bboxX1: number;
|
||||
bboxY1: number;
|
||||
bboxX2: number;
|
||||
bboxY2: number;
|
||||
confidence: number;
|
||||
isConfirmed: boolean;
|
||||
cropUrl?: string | null;
|
||||
fullFrameUrl?: string | null;
|
||||
}>;
|
||||
}>;
|
||||
};
|
||||
|
||||
export type GetSerializedShotPathsQueryVariables = Exact<{
|
||||
filterInput: FilterInput;
|
||||
}>;
|
||||
@@ -6632,6 +6722,32 @@ export const PocketingIntentionFragmentFragmentDoc = gql`
|
||||
difficulty
|
||||
}
|
||||
`;
|
||||
export const PlayerClusterShotFieldsFragmentDoc = gql`
|
||||
fragment PlayerClusterShotFields on PlayerClusterShotGQL {
|
||||
shotId
|
||||
bboxX1
|
||||
bboxY1
|
||||
bboxX2
|
||||
bboxY2
|
||||
confidence
|
||||
isConfirmed
|
||||
cropUrl
|
||||
fullFrameUrl
|
||||
}
|
||||
`;
|
||||
export const PlayerClusterFieldsFragmentDoc = gql`
|
||||
fragment PlayerClusterFields on PlayerClusterGQL {
|
||||
videoId
|
||||
clusterId
|
||||
nShots
|
||||
userId
|
||||
confirmed
|
||||
shots {
|
||||
...PlayerClusterShotFields
|
||||
}
|
||||
}
|
||||
${PlayerClusterShotFieldsFragmentDoc}
|
||||
`;
|
||||
export const ShotWithAllFeaturesFragmentDoc = gql`
|
||||
fragment ShotWithAllFeatures on ShotGQL {
|
||||
id
|
||||
@@ -10235,6 +10351,132 @@ export type GetRunsWithTimestampsQueryResult = Apollo.QueryResult<
|
||||
GetRunsWithTimestampsQuery,
|
||||
GetRunsWithTimestampsQueryVariables
|
||||
>;
|
||||
export const VideoPlayerClustersDocument = gql`
|
||||
query VideoPlayerClusters($videoId: Int!) {
|
||||
videoPlayerClusters(videoId: $videoId) {
|
||||
...PlayerClusterFields
|
||||
}
|
||||
}
|
||||
${PlayerClusterFieldsFragmentDoc}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useVideoPlayerClustersQuery__
|
||||
*
|
||||
* To run a query within a React component, call `useVideoPlayerClustersQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useVideoPlayerClustersQuery` 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 } = useVideoPlayerClustersQuery({
|
||||
* variables: {
|
||||
* videoId: // value for 'videoId'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useVideoPlayerClustersQuery(
|
||||
baseOptions: Apollo.QueryHookOptions<
|
||||
VideoPlayerClustersQuery,
|
||||
VideoPlayerClustersQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useQuery<
|
||||
VideoPlayerClustersQuery,
|
||||
VideoPlayerClustersQueryVariables
|
||||
>(VideoPlayerClustersDocument, options);
|
||||
}
|
||||
export function useVideoPlayerClustersLazyQuery(
|
||||
baseOptions?: Apollo.LazyQueryHookOptions<
|
||||
VideoPlayerClustersQuery,
|
||||
VideoPlayerClustersQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useLazyQuery<
|
||||
VideoPlayerClustersQuery,
|
||||
VideoPlayerClustersQueryVariables
|
||||
>(VideoPlayerClustersDocument, options);
|
||||
}
|
||||
export function useVideoPlayerClustersSuspenseQuery(
|
||||
baseOptions?: Apollo.SuspenseQueryHookOptions<
|
||||
VideoPlayerClustersQuery,
|
||||
VideoPlayerClustersQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useSuspenseQuery<
|
||||
VideoPlayerClustersQuery,
|
||||
VideoPlayerClustersQueryVariables
|
||||
>(VideoPlayerClustersDocument, options);
|
||||
}
|
||||
export type VideoPlayerClustersQueryHookResult = ReturnType<
|
||||
typeof useVideoPlayerClustersQuery
|
||||
>;
|
||||
export type VideoPlayerClustersLazyQueryHookResult = ReturnType<
|
||||
typeof useVideoPlayerClustersLazyQuery
|
||||
>;
|
||||
export type VideoPlayerClustersSuspenseQueryHookResult = ReturnType<
|
||||
typeof useVideoPlayerClustersSuspenseQuery
|
||||
>;
|
||||
export type VideoPlayerClustersQueryResult = Apollo.QueryResult<
|
||||
VideoPlayerClustersQuery,
|
||||
VideoPlayerClustersQueryVariables
|
||||
>;
|
||||
export const FinalizePlayerAssignmentsDocument = gql`
|
||||
mutation FinalizePlayerAssignments($input: FinalizePlayerAssignmentsInput!) {
|
||||
finalizePlayerAssignments(input: $input) {
|
||||
...PlayerClusterFields
|
||||
}
|
||||
}
|
||||
${PlayerClusterFieldsFragmentDoc}
|
||||
`;
|
||||
export type FinalizePlayerAssignmentsMutationFn = Apollo.MutationFunction<
|
||||
FinalizePlayerAssignmentsMutation,
|
||||
FinalizePlayerAssignmentsMutationVariables
|
||||
>;
|
||||
|
||||
/**
|
||||
* __useFinalizePlayerAssignmentsMutation__
|
||||
*
|
||||
* To run a mutation, you first call `useFinalizePlayerAssignmentsMutation` within a React component and pass it any options that fit your needs.
|
||||
* When your component renders, `useFinalizePlayerAssignmentsMutation` returns a tuple that includes:
|
||||
* - A mutate function that you can call at any time to execute the mutation
|
||||
* - An object with fields that represent the current status of the mutation's execution
|
||||
*
|
||||
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
|
||||
*
|
||||
* @example
|
||||
* const [finalizePlayerAssignmentsMutation, { data, loading, error }] = useFinalizePlayerAssignmentsMutation({
|
||||
* variables: {
|
||||
* input: // value for 'input'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useFinalizePlayerAssignmentsMutation(
|
||||
baseOptions?: Apollo.MutationHookOptions<
|
||||
FinalizePlayerAssignmentsMutation,
|
||||
FinalizePlayerAssignmentsMutationVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useMutation<
|
||||
FinalizePlayerAssignmentsMutation,
|
||||
FinalizePlayerAssignmentsMutationVariables
|
||||
>(FinalizePlayerAssignmentsDocument, options);
|
||||
}
|
||||
export type FinalizePlayerAssignmentsMutationHookResult = ReturnType<
|
||||
typeof useFinalizePlayerAssignmentsMutation
|
||||
>;
|
||||
export type FinalizePlayerAssignmentsMutationResult =
|
||||
Apollo.MutationResult<FinalizePlayerAssignmentsMutation>;
|
||||
export type FinalizePlayerAssignmentsMutationOptions =
|
||||
Apollo.BaseMutationOptions<
|
||||
FinalizePlayerAssignmentsMutation,
|
||||
FinalizePlayerAssignmentsMutationVariables
|
||||
>;
|
||||
export const GetSerializedShotPathsDocument = gql`
|
||||
query GetSerializedShotPaths($filterInput: FilterInput!) {
|
||||
getShots(filterInput: $filterInput) {
|
||||
|
||||
Reference in New Issue
Block a user