diff --git a/src/index.tsx b/src/index.tsx index ab28aee..8406cf5 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3088,6 +3088,7 @@ export type Query = { getQuotaStatus: QuotaStatusGql; getResolvedTier: ResolvedTierGql; getRuns: GetRunsResult; + getSessionCoach: SessionCoachGql; getShotAnnotationTypes: Array; getShotTableState: ShotTableStateGql; getShots: Array; @@ -3231,6 +3232,10 @@ export type QueryGetRunsArgs = { runsOrdering?: InputMaybe; }; +export type QueryGetSessionCoachArgs = { + videoId: Scalars["Int"]["input"]; +}; + export type QueryGetShotAnnotationTypesArgs = { errorTypes?: InputMaybe; }; @@ -3546,6 +3551,84 @@ export type SerializedShotPathsGql = { b64EncodedBuffer?: Maybe; }; +export enum SessionCoachCandidateFamilyEnum { + Aiming = "AIMING", + BackCut = "BACK_CUT", + CueToObjectDistance = "CUE_TO_OBJECT_DISTANCE", + CutAngle = "CUT_ANGLE", + ObjectToPocketDistance = "OBJECT_TO_POCKET_DISTANCE", + Spin = "SPIN", +} + +export type SessionCoachCandidateGql = { + __typename?: "SessionCoachCandidateGQL"; + action: Scalars["String"]["output"]; + body: Scalars["String"]["output"]; + drillId?: Maybe; + evidence: SessionCoachEvidenceGql; + family: SessionCoachCandidateFamilyEnum; + id: Scalars["ID"]["output"]; + kind: SessionCoachCandidateKindEnum; + limitations: Array; + rank: Scalars["Int"]["output"]; + supportingShotIds: Array; + title: Scalars["String"]["output"]; +}; + +export enum SessionCoachCandidateKindEnum { + DirectionalMiss = "DIRECTIONAL_MISS", + OutcomePattern = "OUTCOME_PATTERN", + UsagePattern = "USAGE_PATTERN", +} + +export type SessionCoachEvidenceGql = { + __typename?: "SessionCoachEvidenceGQL"; + attemptCount: Scalars["Int"]["output"]; + bucketKey: Scalars["String"]["output"]; + bucketLabel: Scalars["String"]["output"]; + comparisonAttemptCount: Scalars["Int"]["output"]; + comparisonMadeCount: Scalars["Int"]["output"]; + comparisonMakePercentage?: Maybe; + madeCount: Scalars["Int"]["output"]; + makePercentage: Scalars["Float"]["output"]; + missedCount: Scalars["Int"]["output"]; + patternShotCount: Scalars["Int"]["output"]; + rankReason: Scalars["String"]["output"]; + score: Scalars["Float"]["output"]; +}; + +export type SessionCoachGql = { + __typename?: "SessionCoachGQL"; + analysisVersion: Scalars["String"]["output"]; + analyzedShotCount: Scalars["Int"]["output"]; + candidates: Array; + generatedAt: Scalars["DateTime"]["output"]; + ineligibilityReason?: Maybe; + madeCount: Scalars["Int"]["output"]; + makePercentage?: Maybe; + missedCount: Scalars["Int"]["output"]; + primaryCandidate?: Maybe; + processingId?: Maybe; + processingStatus?: Maybe; + shotCount: Scalars["Int"]["output"]; + state: SessionCoachStateEnum; + summary?: Maybe; + unknownOutcomeCount: Scalars["Int"]["output"]; + videoId: Scalars["Int"]["output"]; +}; + +export enum SessionCoachIneligibilityReasonEnum { + Multiplayer = "MULTIPLAYER", +} + +export enum SessionCoachStateEnum { + Failed = "FAILED", + Ineligible = "INELIGIBLE", + NoTrackedShots = "NO_TRACKED_SHOTS", + Processing = "PROCESSING", + Ready = "READY", +} + export type ShotAnnotationGql = { __typename?: "ShotAnnotationGQL"; createdAt?: Maybe; @@ -6766,6 +6849,116 @@ export type GetRunsWithTimestampsQuery = { }; }; +export type GetSessionCoachQueryVariables = Exact<{ + videoId: Scalars["Int"]["input"]; +}>; + +export type GetSessionCoachQuery = { + __typename?: "Query"; + getSessionCoach: { + __typename?: "SessionCoachGQL"; + videoId: number; + processingId?: number | null; + analysisVersion: string; + state: SessionCoachStateEnum; + generatedAt: any; + processingStatus?: string | null; + ineligibilityReason?: SessionCoachIneligibilityReasonEnum | null; + summary?: string | null; + shotCount: number; + madeCount: number; + missedCount: number; + unknownOutcomeCount: number; + analyzedShotCount: number; + makePercentage?: number | null; + primaryCandidate?: { + __typename?: "SessionCoachCandidateGQL"; + id: string; + rank: number; + family: SessionCoachCandidateFamilyEnum; + kind: SessionCoachCandidateKindEnum; + title: string; + body: string; + action: string; + supportingShotIds: Array; + drillId?: string | null; + limitations: Array; + evidence: { + __typename?: "SessionCoachEvidenceGQL"; + bucketKey: string; + bucketLabel: string; + attemptCount: number; + madeCount: number; + missedCount: number; + makePercentage: number; + comparisonAttemptCount: number; + comparisonMadeCount: number; + comparisonMakePercentage?: number | null; + patternShotCount: number; + score: number; + rankReason: string; + }; + } | null; + candidates: Array<{ + __typename?: "SessionCoachCandidateGQL"; + id: string; + rank: number; + family: SessionCoachCandidateFamilyEnum; + kind: SessionCoachCandidateKindEnum; + title: string; + body: string; + action: string; + supportingShotIds: Array; + drillId?: string | null; + limitations: Array; + evidence: { + __typename?: "SessionCoachEvidenceGQL"; + bucketKey: string; + bucketLabel: string; + attemptCount: number; + madeCount: number; + missedCount: number; + makePercentage: number; + comparisonAttemptCount: number; + comparisonMadeCount: number; + comparisonMakePercentage?: number | null; + patternShotCount: number; + score: number; + rankReason: string; + }; + }>; + }; +}; + +export type SessionCoachCandidateFieldsFragment = { + __typename?: "SessionCoachCandidateGQL"; + id: string; + rank: number; + family: SessionCoachCandidateFamilyEnum; + kind: SessionCoachCandidateKindEnum; + title: string; + body: string; + action: string; + supportingShotIds: Array; + drillId?: string | null; + limitations: Array; + evidence: { + __typename?: "SessionCoachEvidenceGQL"; + bucketKey: string; + bucketLabel: string; + attemptCount: number; + madeCount: number; + missedCount: number; + makePercentage: number; + comparisonAttemptCount: number; + comparisonMadeCount: number; + comparisonMakePercentage?: number | null; + patternShotCount: number; + score: number; + rankReason: string; + }; +}; + export type PlayerSummaryFieldsFragment = { __typename?: "PlayerSummaryGQL"; clusterId: number; @@ -9212,6 +9405,34 @@ export const PocketingIntentionFragmentFragmentDoc = gql` difficulty } `; +export const SessionCoachCandidateFieldsFragmentDoc = gql` + fragment SessionCoachCandidateFields on SessionCoachCandidateGQL { + id + rank + family + kind + title + body + action + supportingShotIds + drillId + limitations + evidence { + bucketKey + bucketLabel + attemptCount + madeCount + missedCount + makePercentage + comparisonAttemptCount + comparisonMadeCount + comparisonMakePercentage + patternShotCount + score + rankReason + } + } +`; export const PlayerClusterShotFieldsFragmentDoc = gql` fragment PlayerClusterShotFields on PlayerClusterShotGQL { shotId @@ -14700,6 +14921,99 @@ export type GetRunsWithTimestampsQueryResult = Apollo.QueryResult< GetRunsWithTimestampsQuery, GetRunsWithTimestampsQueryVariables >; +export const GetSessionCoachDocument = gql` + query GetSessionCoach($videoId: Int!) { + getSessionCoach(videoId: $videoId) { + videoId + processingId + analysisVersion + state + generatedAt + processingStatus + ineligibilityReason + summary + shotCount + madeCount + missedCount + unknownOutcomeCount + analyzedShotCount + makePercentage + primaryCandidate { + ...SessionCoachCandidateFields + } + candidates { + ...SessionCoachCandidateFields + } + } + } + ${SessionCoachCandidateFieldsFragmentDoc} +`; + +/** + * __useGetSessionCoachQuery__ + * + * To run a query within a React component, call `useGetSessionCoachQuery` and pass it any options that fit your needs. + * When your component renders, `useGetSessionCoachQuery` 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 } = useGetSessionCoachQuery({ + * variables: { + * videoId: // value for 'videoId' + * }, + * }); + */ +export function useGetSessionCoachQuery( + baseOptions: Apollo.QueryHookOptions< + GetSessionCoachQuery, + GetSessionCoachQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + GetSessionCoachDocument, + options, + ); +} +export function useGetSessionCoachLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GetSessionCoachQuery, + GetSessionCoachQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery< + GetSessionCoachQuery, + GetSessionCoachQueryVariables + >(GetSessionCoachDocument, options); +} +export function useGetSessionCoachSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + GetSessionCoachQuery, + GetSessionCoachQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery< + GetSessionCoachQuery, + GetSessionCoachQueryVariables + >(GetSessionCoachDocument, options); +} +export type GetSessionCoachQueryHookResult = ReturnType< + typeof useGetSessionCoachQuery +>; +export type GetSessionCoachLazyQueryHookResult = ReturnType< + typeof useGetSessionCoachLazyQuery +>; +export type GetSessionCoachSuspenseQueryHookResult = ReturnType< + typeof useGetSessionCoachSuspenseQuery +>; +export type GetSessionCoachQueryResult = Apollo.QueryResult< + GetSessionCoachQuery, + GetSessionCoachQueryVariables +>; export const VideoPlayerClustersDocument = gql` query VideoPlayerClusters($videoId: Int!) { videoPlayerClusters(videoId: $videoId) { diff --git a/src/operations/session-coach.gql b/src/operations/session-coach.gql new file mode 100644 index 0000000..70131fc --- /dev/null +++ b/src/operations/session-coach.gql @@ -0,0 +1,51 @@ +query GetSessionCoach($videoId: Int!) { + getSessionCoach(videoId: $videoId) { + videoId + processingId + analysisVersion + state + generatedAt + processingStatus + ineligibilityReason + summary + shotCount + madeCount + missedCount + unknownOutcomeCount + analyzedShotCount + makePercentage + primaryCandidate { + ...SessionCoachCandidateFields + } + candidates { + ...SessionCoachCandidateFields + } + } +} + +fragment SessionCoachCandidateFields on SessionCoachCandidateGQL { + id + rank + family + kind + title + body + action + supportingShotIds + drillId + limitations + evidence { + bucketKey + bucketLabel + attemptCount + madeCount + missedCount + makePercentage + comparisonAttemptCount + comparisonMadeCount + comparisonMakePercentage + patternShotCount + score + rankReason + } +} diff --git a/src/schema.gql b/src/schema.gql index 8c13c59..63eae2f 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -65,6 +65,7 @@ type Query { limit: Int! = 500 countRespectsLimit: Boolean! = false ): GetRunsResult! + getSessionCoach(videoId: Int!): SessionCoachGQL! videoPlayerClusters(videoId: Int!): [PlayerClusterGQL!]! getShotAnnotationTypes(errorTypes: Boolean = false): [ShotAnnotationTypeGQL!]! getTableState( @@ -995,6 +996,81 @@ input DatetimeOrdering { startingAt: DateTime = null } +type SessionCoachGQL { + videoId: Int! + processingId: Int + analysisVersion: String! + state: SessionCoachStateEnum! + generatedAt: DateTime! + processingStatus: String + ineligibilityReason: SessionCoachIneligibilityReasonEnum + summary: String + shotCount: Int! + madeCount: Int! + missedCount: Int! + unknownOutcomeCount: Int! + analyzedShotCount: Int! + makePercentage: Float + primaryCandidate: SessionCoachCandidateGQL + candidates: [SessionCoachCandidateGQL!]! +} + +enum SessionCoachStateEnum { + PROCESSING + READY + NO_TRACKED_SHOTS + INELIGIBLE + FAILED +} + +enum SessionCoachIneligibilityReasonEnum { + MULTIPLAYER +} + +type SessionCoachCandidateGQL { + id: ID! + rank: Int! + family: SessionCoachCandidateFamilyEnum! + kind: SessionCoachCandidateKindEnum! + title: String! + body: String! + action: String! + supportingShotIds: [Int!]! + drillId: String + evidence: SessionCoachEvidenceGQL! + limitations: [String!]! +} + +enum SessionCoachCandidateFamilyEnum { + AIMING + CUT_ANGLE + SPIN + OBJECT_TO_POCKET_DISTANCE + CUE_TO_OBJECT_DISTANCE + BACK_CUT +} + +enum SessionCoachCandidateKindEnum { + DIRECTIONAL_MISS + OUTCOME_PATTERN + USAGE_PATTERN +} + +type SessionCoachEvidenceGQL { + bucketKey: String! + bucketLabel: String! + attemptCount: Int! + madeCount: Int! + missedCount: Int! + makePercentage: Float! + comparisonAttemptCount: Int! + comparisonMadeCount: Int! + comparisonMakePercentage: Float + patternShotCount: Int! + score: Float! + rankReason: String! +} + type PlayerClusterGQL { videoId: Int! clusterId: Int!