Merge pull request 'Return ShotGQL w/ updateShotAnnotations' (#84) from loewy/annotations-return into master

Reviewed-on: #84
Reviewed-by: Ivan Malison <ivanmalison@gmail.com>
This commit is contained in:
loewy 2024-10-24 10:54:05 -06:00
commit 8246699915
3 changed files with 48 additions and 52 deletions

View File

@ -2412,15 +2412,6 @@ export type SuccessfulAddAddShotAnnotationErrors =
| AddShotAnnotationErrors | AddShotAnnotationErrors
| SuccessfulAdd; | SuccessfulAdd;
export type SuccessfulUpdate = {
__typename?: "SuccessfulUpdate";
value: Scalars["Boolean"]["output"];
};
export type SuccessfulUpdateUpdateShotAnnotationErrors =
| SuccessfulUpdate
| UpdateShotAnnotationErrors;
export type TagGql = { export type TagGql = {
__typename?: "TagGQL"; __typename?: "TagGQL";
group?: Maybe<Scalars["String"]["output"]>; group?: Maybe<Scalars["String"]["output"]>;
@ -2463,14 +2454,10 @@ export type UpdateAnnotationInputGql = {
notes?: InputMaybe<Scalars["String"]["input"]>; notes?: InputMaybe<Scalars["String"]["input"]>;
}; };
export type UpdateShotAnnotationErrors = {
__typename?: "UpdateShotAnnotationErrors";
error?: Maybe<DoesNotOwnShotErr>;
};
export type UpdateShotAnnotationReturn = { export type UpdateShotAnnotationReturn = {
__typename?: "UpdateShotAnnotationReturn"; __typename?: "UpdateShotAnnotationReturn";
value: SuccessfulUpdateUpdateShotAnnotationErrors; error?: Maybe<DoesNotOwnShotErr>;
shot?: Maybe<ShotGql>;
}; };
export type UploadLink = { export type UploadLink = {
@ -2783,16 +2770,26 @@ export type UpdateShotAnnotationsMutation = {
__typename?: "Mutation"; __typename?: "Mutation";
updateShotAnnotations: { updateShotAnnotations: {
__typename?: "UpdateShotAnnotationReturn"; __typename?: "UpdateShotAnnotationReturn";
value: shot?: {
| { __typename?: "SuccessfulUpdate"; value: boolean } __typename?: "ShotGQL";
| { id: number;
__typename?: "UpdateShotAnnotationErrors"; annotations: Array<{
error?: { __typename?: "ShotAnnotationGQL";
__typename?: "DoesNotOwnShotErr"; shotId: number;
shotId: number; notes: string;
msg?: string | null; errorDefault: boolean;
} | null; type: {
__typename?: "ShotAnnotationTypeGQL";
id: number;
name: string;
}; };
}>;
} | null;
error?: {
__typename?: "DoesNotOwnShotErr";
shotId: number;
msg?: string | null;
} | null;
}; };
}; };
@ -4372,17 +4369,22 @@ export const UpdateShotAnnotationsDocument = gql`
$annotations: [UpdateAnnotationInputGQL!]! $annotations: [UpdateAnnotationInputGQL!]!
) { ) {
updateShotAnnotations(shotId: $shotId, annotations: $annotations) { updateShotAnnotations(shotId: $shotId, annotations: $annotations) {
value { shot {
... on SuccessfulUpdate { id
value annotations {
} shotId
... on UpdateShotAnnotationErrors { type {
error { id
shotId name
msg
} }
notes
errorDefault
} }
} }
error {
shotId
msg
}
} }
} }
`; `;

View File

@ -22,17 +22,22 @@ mutation UpdateShotAnnotations(
$annotations: [UpdateAnnotationInputGQL!]! $annotations: [UpdateAnnotationInputGQL!]!
) { ) {
updateShotAnnotations(shotId: $shotId, annotations: $annotations) { updateShotAnnotations(shotId: $shotId, annotations: $annotations) {
value { shot {
... on SuccessfulUpdate { id
value annotations {
} shotId
... on UpdateShotAnnotationErrors { type {
error { id
shotId name
msg
} }
notes
errorDefault
} }
} }
error {
shotId
msg
}
} }
} }

View File

@ -662,18 +662,7 @@ type OtherErrorNeedsNote {
} }
type UpdateShotAnnotationReturn { type UpdateShotAnnotationReturn {
value: SuccessfulUpdateUpdateShotAnnotationErrors! shot: ShotGQL
}
union SuccessfulUpdateUpdateShotAnnotationErrors =
SuccessfulUpdate
| UpdateShotAnnotationErrors
type SuccessfulUpdate {
value: Boolean!
}
type UpdateShotAnnotationErrors {
error: DoesNotOwnShotErr error: DoesNotOwnShotErr
} }