From a78f9e7b9d1565163e4dd2f76443db46dddd2081 Mon Sep 17 00:00:00 2001 From: Loewy Date: Wed, 23 Oct 2024 15:51:53 -0700 Subject: [PATCH] return shot gql with an annotation update --- src/index.tsx | 66 +++++++++++++++++++++------------------- src/operations/shots.gql | 21 ++++++++----- src/schema.gql | 13 +------- 3 files changed, 48 insertions(+), 52 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 211a0ef..83ac7bc 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2412,15 +2412,6 @@ export type SuccessfulAddAddShotAnnotationErrors = | AddShotAnnotationErrors | SuccessfulAdd; -export type SuccessfulUpdate = { - __typename?: "SuccessfulUpdate"; - value: Scalars["Boolean"]["output"]; -}; - -export type SuccessfulUpdateUpdateShotAnnotationErrors = - | SuccessfulUpdate - | UpdateShotAnnotationErrors; - export type TagGql = { __typename?: "TagGQL"; group?: Maybe; @@ -2463,14 +2454,10 @@ export type UpdateAnnotationInputGql = { notes?: InputMaybe; }; -export type UpdateShotAnnotationErrors = { - __typename?: "UpdateShotAnnotationErrors"; - error?: Maybe; -}; - export type UpdateShotAnnotationReturn = { __typename?: "UpdateShotAnnotationReturn"; - value: SuccessfulUpdateUpdateShotAnnotationErrors; + error?: Maybe; + shot?: Maybe; }; export type UploadLink = { @@ -2783,16 +2770,26 @@ export type UpdateShotAnnotationsMutation = { __typename?: "Mutation"; updateShotAnnotations: { __typename?: "UpdateShotAnnotationReturn"; - value: - | { __typename?: "SuccessfulUpdate"; value: boolean } - | { - __typename?: "UpdateShotAnnotationErrors"; - error?: { - __typename?: "DoesNotOwnShotErr"; - shotId: number; - msg?: string | null; - } | null; + shot?: { + __typename?: "ShotGQL"; + id: number; + annotations: Array<{ + __typename?: "ShotAnnotationGQL"; + shotId: number; + notes: string; + errorDefault: boolean; + type: { + __typename?: "ShotAnnotationTypeGQL"; + id: number; + name: string; }; + }>; + } | null; + error?: { + __typename?: "DoesNotOwnShotErr"; + shotId: number; + msg?: string | null; + } | null; }; }; @@ -4355,17 +4352,22 @@ export const UpdateShotAnnotationsDocument = gql` $annotations: [UpdateAnnotationInputGQL!]! ) { updateShotAnnotations(shotId: $shotId, annotations: $annotations) { - value { - ... on SuccessfulUpdate { - value - } - ... on UpdateShotAnnotationErrors { - error { - shotId - msg + shot { + id + annotations { + shotId + type { + id + name } + notes + errorDefault } } + error { + shotId + msg + } } } `; diff --git a/src/operations/shots.gql b/src/operations/shots.gql index 1d97898..9aa6e65 100644 --- a/src/operations/shots.gql +++ b/src/operations/shots.gql @@ -22,17 +22,22 @@ mutation UpdateShotAnnotations( $annotations: [UpdateAnnotationInputGQL!]! ) { updateShotAnnotations(shotId: $shotId, annotations: $annotations) { - value { - ... on SuccessfulUpdate { - value - } - ... on UpdateShotAnnotationErrors { - error { - shotId - msg + shot { + id + annotations { + shotId + type { + id + name } + notes + errorDefault } } + error { + shotId + msg + } } } diff --git a/src/schema.gql b/src/schema.gql index 6132541..fd59f66 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -662,18 +662,7 @@ type OtherErrorNeedsNote { } type UpdateShotAnnotationReturn { - value: SuccessfulUpdateUpdateShotAnnotationErrors! -} - -union SuccessfulUpdateUpdateShotAnnotationErrors = - SuccessfulUpdate - | UpdateShotAnnotationErrors - -type SuccessfulUpdate { - value: Boolean! -} - -type UpdateShotAnnotationErrors { + shot: ShotGQL error: DoesNotOwnShotErr }