Compare commits
9 Commits
dcdb324391
...
kat/create
| Author | SHA1 | Date | |
|---|---|---|---|
| 301c017d5e | |||
| 1a4b676635 | |||
| ce54bef0b4 | |||
| 2699d29d7b | |||
| 63a07d58ca | |||
| 59fe332fe0 | |||
| 33723f4ea2 | |||
| c0ee55069e | |||
| 492ae4a225 |
237
src/index.tsx
237
src/index.tsx
@@ -72,6 +72,12 @@ export type AggregationInput =
|
||||
}
|
||||
| { bucketSet?: never; datetimeRange?: never; enum: EnumAggregation };
|
||||
|
||||
export enum AlignedIntervalEnum {
|
||||
Month = "MONTH",
|
||||
Week = "WEEK",
|
||||
Year = "YEAR",
|
||||
}
|
||||
|
||||
export type BankFeaturesGql = {
|
||||
__typename?: "BankFeaturesGQL";
|
||||
bankAngle: Scalars["Float"]["output"];
|
||||
@@ -1503,6 +1509,7 @@ export type GetShotsPagination = {
|
||||
export type GetShotsResult = {
|
||||
__typename?: "GetShotsResult";
|
||||
count?: Maybe<Scalars["Int"]["output"]>;
|
||||
ids: Array<Scalars["Int"]["output"]>;
|
||||
shots: Array<ShotGql>;
|
||||
};
|
||||
|
||||
@@ -1727,6 +1734,7 @@ export type Query = {
|
||||
getPlayTime: UserPlayTimeGql;
|
||||
getShotAnnotationTypes: Array<ShotAnnotationTypeGql>;
|
||||
getShots: Array<ShotGql>;
|
||||
getShotsByIds: Array<ShotGql>;
|
||||
getShotsWithMetadata: GetShotsResult;
|
||||
getUser?: Maybe<UserGql>;
|
||||
getUserTags: Array<TagGql>;
|
||||
@@ -1760,6 +1768,10 @@ export type QueryGetShotsArgs = {
|
||||
shotsPagination?: InputMaybe<GetShotsPagination>;
|
||||
};
|
||||
|
||||
export type QueryGetShotsByIdsArgs = {
|
||||
ids: Array<Scalars["Int"]["input"]>;
|
||||
};
|
||||
|
||||
export type QueryGetShotsWithMetadataArgs = {
|
||||
filterInput: FilterInput;
|
||||
limit?: Scalars["Int"]["input"];
|
||||
@@ -1914,20 +1926,17 @@ export type TargetMetricsGql = {
|
||||
spinTypeCounts?: Maybe<SpinTypeCountsGql>;
|
||||
};
|
||||
|
||||
export type TimeInterval = {
|
||||
/** True eg 1/15-3/15 => [(1/15,1/31), (2/1,2/28), (3/1,3/15)] False eg 1/15-2/15 => [(1/15,2/14), (2/14,3/15)] */
|
||||
calendarAlignedMonths?: Scalars["Boolean"]["input"];
|
||||
export type TimeDeltaGql = {
|
||||
days?: InputMaybe<Scalars["Int"]["input"]>;
|
||||
hours?: InputMaybe<Scalars["Int"]["input"]>;
|
||||
minutes?: InputMaybe<Scalars["Int"]["input"]>;
|
||||
months?: InputMaybe<Scalars["Int"]["input"]>;
|
||||
/** A second is the base unit and cannot be subdivided */
|
||||
seconds?: InputMaybe<Scalars["Int"]["input"]>;
|
||||
weeks?: InputMaybe<Scalars["Int"]["input"]>;
|
||||
/** Assumes a year is 365 days long */
|
||||
years?: InputMaybe<Scalars["Int"]["input"]>;
|
||||
};
|
||||
|
||||
export type TimeInterval =
|
||||
| { aligned: AlignedIntervalEnum; timedelta?: never }
|
||||
| { aligned?: never; timedelta: TimeDeltaGql };
|
||||
|
||||
export type TooManyInitUploadsErr = {
|
||||
__typename?: "TooManyInitUploadsErr";
|
||||
linksRequested: Scalars["Int"]["output"];
|
||||
@@ -2343,10 +2352,100 @@ export type GetShotsWithMetadataQuery = {
|
||||
};
|
||||
} | 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;
|
||||
pocketingIntentionInfo?: {
|
||||
__typename?: "PocketingIntentionInfoGQL";
|
||||
ballId: number;
|
||||
pocketId: PocketIdentifier;
|
||||
pathMetadataIndex: number;
|
||||
} | null;
|
||||
serializedShotPaths?: {
|
||||
__typename?: "SerializedShotPathsGQL";
|
||||
b64EncodedBuffer?: string | null;
|
||||
} | null;
|
||||
}>;
|
||||
};
|
||||
};
|
||||
|
||||
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;
|
||||
@@ -2363,7 +2462,6 @@ export type GetShotsWithMetadataQuery = {
|
||||
} | null;
|
||||
}>;
|
||||
};
|
||||
};
|
||||
|
||||
export type GetProfileImageUploadLinkMutationVariables = Exact<{
|
||||
fileExt?: InputMaybe<Scalars["String"]["input"]>;
|
||||
@@ -2908,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) {
|
||||
@@ -3572,9 +3705,6 @@ export const GetShotsWithMetadataDocument = gql`
|
||||
}
|
||||
}
|
||||
}
|
||||
serializedShotPaths {
|
||||
b64EncodedBuffer
|
||||
}
|
||||
createdAt @include(if: $includeCreatedAt)
|
||||
updatedAt @include(if: $includeUpdatedAt)
|
||||
cueObjectFeatures @include(if: $includeCueObjectFeatures) {
|
||||
@@ -3590,6 +3720,15 @@ export const GetShotsWithMetadataDocument = gql`
|
||||
make @include(if: $includeMake)
|
||||
intendedPocketType @include(if: $includeIntendedPocketType)
|
||||
}
|
||||
pocketingIntentionInfo
|
||||
@include(if: $includePocketingIntentionFeatures) {
|
||||
ballId
|
||||
pocketId
|
||||
pathMetadataIndex
|
||||
}
|
||||
serializedShotPaths @include(if: $includePocketingIntentionFeatures) {
|
||||
b64EncodedBuffer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3674,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) {
|
||||
|
||||
@@ -113,10 +113,6 @@ query GetShotsWithMetadata(
|
||||
}
|
||||
}
|
||||
}
|
||||
serializedShotPaths {
|
||||
b64EncodedBuffer
|
||||
}
|
||||
|
||||
createdAt @include(if: $includeCreatedAt)
|
||||
updatedAt @include(if: $includeUpdatedAt)
|
||||
cueObjectFeatures @include(if: $includeCueObjectFeatures) {
|
||||
@@ -132,6 +128,54 @@ query GetShotsWithMetadata(
|
||||
make @include(if: $includeMake)
|
||||
intendedPocketType @include(if: $includeIntendedPocketType)
|
||||
}
|
||||
pocketingIntentionInfo @include(if: $includePocketingIntentionFeatures) {
|
||||
ballId
|
||||
pocketId
|
||||
pathMetadataIndex
|
||||
}
|
||||
serializedShotPaths @include(if: $includePocketingIntentionFeatures) {
|
||||
b64EncodedBuffer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ type Query {
|
||||
shotsPagination: GetShotsPagination = null
|
||||
limit: Int! = 500
|
||||
): [ShotGQL!]!
|
||||
getShotsByIds(ids: [Int!]!): [ShotGQL!]!
|
||||
getShotAnnotationTypes(errorTypes: Boolean = false): [ShotAnnotationTypeGQL!]!
|
||||
getUser(userId: Int!): UserGQL
|
||||
getLoggedInUser: UserGQL
|
||||
@@ -107,26 +108,22 @@ Date with time (isoformat)
|
||||
"""
|
||||
scalar DateTime
|
||||
|
||||
input TimeInterval {
|
||||
"""
|
||||
A second is the base unit and cannot be subdivided
|
||||
"""
|
||||
seconds: Int = 0
|
||||
minutes: Int = 0
|
||||
hours: Int = 0
|
||||
input TimeInterval @oneOf {
|
||||
timedelta: TimeDeltaGQL
|
||||
aligned: AlignedIntervalEnum
|
||||
}
|
||||
|
||||
input TimeDeltaGQL {
|
||||
days: Int = 0
|
||||
weeks: Int = 0
|
||||
months: Int = 0
|
||||
|
||||
"""
|
||||
Assumes a year is 365 days long
|
||||
"""
|
||||
years: Int = 0
|
||||
}
|
||||
|
||||
"""
|
||||
True eg 1/15-3/15 => [(1/15,1/31), (2/1,2/28), (3/1,3/15)] False eg 1/15-2/15 => [(1/15,2/14), (2/14,3/15)]
|
||||
"""
|
||||
calendarAlignedMonths: Boolean! = true
|
||||
enum AlignedIntervalEnum {
|
||||
MONTH
|
||||
YEAR
|
||||
WEEK
|
||||
}
|
||||
|
||||
input FilterInput @oneOf {
|
||||
@@ -248,6 +245,7 @@ type MakePercentageIntervalGQL {
|
||||
type GetShotsResult {
|
||||
shots: [ShotGQL!]!
|
||||
count: Int
|
||||
ids: [Int!]!
|
||||
}
|
||||
|
||||
type ShotGQL {
|
||||
|
||||
Reference in New Issue
Block a user