diff --git a/src/index.tsx b/src/index.tsx index a6bbe52..49ac198 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3512,6 +3512,74 @@ export type ShotWithAllFeaturesFragment = { }>; }; +export type EditShotMutationVariables = Exact<{ + shotId: Scalars["Int"]["input"]; + fieldsToEdit: EditableShotFieldInputGql; +}>; + +export type EditShotMutation = { + __typename?: "Mutation"; + editShot: { + __typename?: "EditShotReturn"; + error?: { + __typename?: "DoesNotOwnShotErr"; + shotId: number; + msg?: string | null; + } | null; + shot?: { + __typename?: "ShotGQL"; + id: number; + videoId: number; + startFrame: number; + endFrame: number; + startTime: number; + endTime: number; + falsePositiveScore?: number | null; + createdAt?: any | null; + updatedAt?: any | null; + user?: { __typename?: "UserGQL"; id: number } | null; + cueObjectFeatures?: { + __typename?: "CueObjectFeaturesGQL"; + cueObjectDistance?: number | null; + cueObjectAngle?: number | null; + cueBallSpeed?: number | null; + shotDirection?: ShotDirectionEnum | null; + spinType?: SpinTypeEnum | null; + } | null; + pocketingIntentionFeatures?: { + __typename?: "PocketingIntentionFeaturesGQL"; + make?: boolean | null; + targetPocketDistance?: number | null; + targetPocketAngle?: number | null; + targetPocketAngleDirection?: ShotDirectionEnum | null; + marginOfErrorInDegrees?: number | null; + intendedPocketType?: PocketEnum | null; + difficulty?: number | null; + } | null; + pocketingIntentionInfo?: { + __typename?: "PocketingIntentionInfoGQL"; + ballId: number; + pocketId: PocketIdentifier; + pathMetadataIndex: number; + } | null; + serializedShotPaths?: { + __typename?: "SerializedShotPathsGQL"; + b64EncodedBuffer?: string | null; + } | null; + annotations: Array<{ + __typename?: "ShotAnnotationGQL"; + shotId: number; + notes: string; + type: { + __typename?: "ShotAnnotationTypeGQL"; + id: number; + name: string; + }; + }>; + } | null; + }; +}; + export type GetProfileImageUploadLinkMutationVariables = Exact<{ fileExt?: InputMaybe; }>; @@ -5807,6 +5875,61 @@ export type GetShotsByIdsQueryResult = Apollo.QueryResult< GetShotsByIdsQuery, GetShotsByIdsQueryVariables >; +export const EditShotDocument = gql` + mutation EditShot($shotId: Int!, $fieldsToEdit: EditableShotFieldInputGQL!) { + editShot(shotId: $shotId, fieldsToEdit: $fieldsToEdit) { + error { + shotId + msg + } + shot { + ...ShotWithAllFeatures + } + } + } + ${ShotWithAllFeaturesFragmentDoc} +`; +export type EditShotMutationFn = Apollo.MutationFunction< + EditShotMutation, + EditShotMutationVariables +>; + +/** + * __useEditShotMutation__ + * + * To run a mutation, you first call `useEditShotMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useEditShotMutation` 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 [editShotMutation, { data, loading, error }] = useEditShotMutation({ + * variables: { + * shotId: // value for 'shotId' + * fieldsToEdit: // value for 'fieldsToEdit' + * }, + * }); + */ +export function useEditShotMutation( + baseOptions?: Apollo.MutationHookOptions< + EditShotMutation, + EditShotMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation( + EditShotDocument, + options, + ); +} +export type EditShotMutationHookResult = ReturnType; +export type EditShotMutationResult = Apollo.MutationResult; +export type EditShotMutationOptions = Apollo.BaseMutationOptions< + EditShotMutation, + EditShotMutationVariables +>; export const GetProfileImageUploadLinkDocument = gql` mutation getProfileImageUploadLink($fileExt: String = ".png") { getProfileImageUploadLink(fileExt: $fileExt) { diff --git a/src/operations/shots.gql b/src/operations/shots.gql index 6d28054..f0187e7 100644 --- a/src/operations/shots.gql +++ b/src/operations/shots.gql @@ -178,3 +178,15 @@ fragment ShotWithAllFeatures on ShotGQL { notes } } + +mutation EditShot($shotId: Int!, $fieldsToEdit: EditableShotFieldInputGQL!) { + editShot(shotId: $shotId, fieldsToEdit: $fieldsToEdit) { + error { + shotId + msg + } + shot { + ...ShotWithAllFeatures + } + } +}