Create gql query for shot data
This commit is contained in:
parent
582cf4fe75
commit
e23546de88
@ -355,6 +355,20 @@ export enum WallTypeEnum {
|
|||||||
Short = 'SHORT'
|
Short = 'SHORT'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type GetShotsQueryVariables = Exact<{
|
||||||
|
filterInput?: InputMaybe<FilterInput>;
|
||||||
|
includeCueObjectDistance?: Scalars['Boolean']['input'];
|
||||||
|
includeCueObjectAngle?: Scalars['Boolean']['input'];
|
||||||
|
includeCueBallSpeed?: Scalars['Boolean']['input'];
|
||||||
|
includeShotDirection?: Scalars['Boolean']['input'];
|
||||||
|
includeTargetPocketDistance?: Scalars['Boolean']['input'];
|
||||||
|
includeMake?: Scalars['Boolean']['input'];
|
||||||
|
includeIntendedPocketType?: Scalars['Boolean']['input'];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
|
||||||
|
export type GetShotsQuery = { __typename?: 'Query', getShots: Array<{ __typename?: 'ShotGQL', id?: number | null, videoId?: number | null, startFrame?: number | null, endFrame?: number | null, createdAt?: any | null, updatedAt?: any | null, cueObjectFeatures?: { __typename?: 'CueObjectFeaturesGQL', cueObjectDistance?: number | null, cueObjectAngle?: number | null, cueBallSpeed?: number | null, shotDirection?: ShotDirectionEnum | null } | null, pocketingIntentionFeatures?: { __typename?: 'PocketingIntentionFeaturesGQL', targetPocketDistance?: number | null, make?: boolean | null, intendedPocketType?: PocketEnum | null } | null }> };
|
||||||
|
|
||||||
export type CreateUploadStreamMutationVariables = Exact<{
|
export type CreateUploadStreamMutationVariables = Exact<{
|
||||||
videoName: Scalars['String']['input'];
|
videoName: Scalars['String']['input'];
|
||||||
deviceType?: InputMaybe<DeviceTypeEnum>;
|
deviceType?: InputMaybe<DeviceTypeEnum>;
|
||||||
@ -387,6 +401,69 @@ export type TerminateUploadStreamMutationVariables = Exact<{
|
|||||||
export type TerminateUploadStreamMutation = { __typename?: 'Mutation', terminateUploadStream: boolean };
|
export type TerminateUploadStreamMutation = { __typename?: 'Mutation', terminateUploadStream: boolean };
|
||||||
|
|
||||||
|
|
||||||
|
export const GetShotsDocument = gql`
|
||||||
|
query GetShots($filterInput: FilterInput, $includeCueObjectDistance: Boolean! = false, $includeCueObjectAngle: Boolean! = false, $includeCueBallSpeed: Boolean! = false, $includeShotDirection: Boolean! = false, $includeTargetPocketDistance: Boolean! = false, $includeMake: Boolean! = false, $includeIntendedPocketType: Boolean! = false) {
|
||||||
|
getShots(filterInput: $filterInput) {
|
||||||
|
id
|
||||||
|
videoId
|
||||||
|
startFrame
|
||||||
|
endFrame
|
||||||
|
createdAt
|
||||||
|
updatedAt
|
||||||
|
cueObjectFeatures {
|
||||||
|
cueObjectDistance @include(if: $includeCueObjectDistance)
|
||||||
|
cueObjectAngle @include(if: $includeCueObjectAngle)
|
||||||
|
cueBallSpeed @include(if: $includeCueBallSpeed)
|
||||||
|
shotDirection @include(if: $includeShotDirection)
|
||||||
|
}
|
||||||
|
pocketingIntentionFeatures {
|
||||||
|
targetPocketDistance @include(if: $includeTargetPocketDistance)
|
||||||
|
make @include(if: $includeMake)
|
||||||
|
intendedPocketType @include(if: $includeIntendedPocketType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __useGetShotsQuery__
|
||||||
|
*
|
||||||
|
* To run a query within a React component, call `useGetShotsQuery` and pass it any options that fit your needs.
|
||||||
|
* When your component renders, `useGetShotsQuery` 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 } = useGetShotsQuery({
|
||||||
|
* variables: {
|
||||||
|
* filterInput: // value for 'filterInput'
|
||||||
|
* includeCueObjectDistance: // value for 'includeCueObjectDistance'
|
||||||
|
* includeCueObjectAngle: // value for 'includeCueObjectAngle'
|
||||||
|
* includeCueBallSpeed: // value for 'includeCueBallSpeed'
|
||||||
|
* includeShotDirection: // value for 'includeShotDirection'
|
||||||
|
* includeTargetPocketDistance: // value for 'includeTargetPocketDistance'
|
||||||
|
* includeMake: // value for 'includeMake'
|
||||||
|
* includeIntendedPocketType: // value for 'includeIntendedPocketType'
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
*/
|
||||||
|
export function useGetShotsQuery(baseOptions?: Apollo.QueryHookOptions<GetShotsQuery, GetShotsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useQuery<GetShotsQuery, GetShotsQueryVariables>(GetShotsDocument, options);
|
||||||
|
}
|
||||||
|
export function useGetShotsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetShotsQuery, GetShotsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useLazyQuery<GetShotsQuery, GetShotsQueryVariables>(GetShotsDocument, options);
|
||||||
|
}
|
||||||
|
export function useGetShotsSuspenseQuery(baseOptions?: Apollo.SuspenseQueryHookOptions<GetShotsQuery, GetShotsQueryVariables>) {
|
||||||
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
|
return Apollo.useSuspenseQuery<GetShotsQuery, GetShotsQueryVariables>(GetShotsDocument, options);
|
||||||
|
}
|
||||||
|
export type GetShotsQueryHookResult = ReturnType<typeof useGetShotsQuery>;
|
||||||
|
export type GetShotsLazyQueryHookResult = ReturnType<typeof useGetShotsLazyQuery>;
|
||||||
|
export type GetShotsSuspenseQueryHookResult = ReturnType<typeof useGetShotsSuspenseQuery>;
|
||||||
|
export type GetShotsQueryResult = Apollo.QueryResult<GetShotsQuery, GetShotsQueryVariables>;
|
||||||
export const CreateUploadStreamDocument = gql`
|
export const CreateUploadStreamDocument = gql`
|
||||||
mutation CreateUploadStream($videoName: String!, $deviceType: DeviceTypeEnum, $osVersion: String, $appVersion: String, $browserName: String, $browserVersion: String, $locale: String, $timezone: String, $networkType: String, $ipAddress: String) {
|
mutation CreateUploadStream($videoName: String!, $deviceType: DeviceTypeEnum, $osVersion: String, $appVersion: String, $browserName: String, $browserVersion: String, $locale: String, $timezone: String, $networkType: String, $ipAddress: String) {
|
||||||
createUploadStream(
|
createUploadStream(
|
||||||
|
30
src/operations/shot_data.gql
Normal file
30
src/operations/shot_data.gql
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
query GetShots(
|
||||||
|
$filterInput: FilterInput
|
||||||
|
$includeCueObjectDistance: Boolean! = false
|
||||||
|
$includeCueObjectAngle: Boolean! = false
|
||||||
|
$includeCueBallSpeed: Boolean! = false
|
||||||
|
$includeShotDirection: Boolean! = false
|
||||||
|
$includeTargetPocketDistance: Boolean! = false
|
||||||
|
$includeMake: Boolean! = false
|
||||||
|
$includeIntendedPocketType: Boolean! = false
|
||||||
|
) {
|
||||||
|
getShots(filterInput: $filterInput) {
|
||||||
|
id
|
||||||
|
videoId
|
||||||
|
startFrame
|
||||||
|
endFrame
|
||||||
|
createdAt
|
||||||
|
updatedAt
|
||||||
|
cueObjectFeatures {
|
||||||
|
cueObjectDistance @include(if: $includeCueObjectDistance)
|
||||||
|
cueObjectAngle @include(if: $includeCueObjectAngle)
|
||||||
|
cueBallSpeed @include(if: $includeCueBallSpeed)
|
||||||
|
shotDirection @include(if: $includeShotDirection)
|
||||||
|
}
|
||||||
|
pocketingIntentionFeatures {
|
||||||
|
targetPocketDistance @include(if: $includeTargetPocketDistance)
|
||||||
|
make @include(if: $includeMake)
|
||||||
|
intendedPocketType @include(if: $includeIntendedPocketType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user