Return ShotGQL w/ updateShotAnnotations #84

Merged
loewy merged 2 commits from loewy/annotations-return into master 2024-10-24 10:54:06 -06:00
3 changed files with 48 additions and 52 deletions
Showing only changes of commit a78f9e7b9d - Show all commits

View File

@ -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<Scalars["String"]["output"]>;
@ -2463,14 +2454,10 @@ export type UpdateAnnotationInputGql = {
notes?: InputMaybe<Scalars["String"]["input"]>;
};
export type UpdateShotAnnotationErrors = {
__typename?: "UpdateShotAnnotationErrors";
error?: Maybe<DoesNotOwnShotErr>;
};
export type UpdateShotAnnotationReturn = {
__typename?: "UpdateShotAnnotationReturn";
value: SuccessfulUpdateUpdateShotAnnotationErrors;
error?: Maybe<DoesNotOwnShotErr>;
shot?: Maybe<ShotGql>;
};
export type UploadLink = {
@ -2783,10 +2770,21 @@ export type UpdateShotAnnotationsMutation = {
__typename?: "Mutation";
updateShotAnnotations: {
__typename?: "UpdateShotAnnotationReturn";
value:
| { __typename?: "SuccessfulUpdate"; value: boolean }
| {
__typename?: "UpdateShotAnnotationErrors";
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;
@ -2794,7 +2792,6 @@ export type UpdateShotAnnotationsMutation = {
} | null;
};
};
};
export type GetShotsWithVideoGqlQueryVariables = Exact<{
filterInput: FilterInput;
@ -4355,19 +4352,24 @@ export const UpdateShotAnnotationsDocument = gql`
$annotations: [UpdateAnnotationInputGQL!]!
) {
updateShotAnnotations(shotId: $shotId, annotations: $annotations) {
value {
... on SuccessfulUpdate {
value
shot {
id
annotations {
shotId
type {
id
name
}
notes
errorDefault
}
}
... on UpdateShotAnnotationErrors {
error {
shotId
msg
}
}
}
}
}
`;
export type UpdateShotAnnotationsMutationFn = Apollo.MutationFunction<
UpdateShotAnnotationsMutation,

View File

@ -22,19 +22,24 @@ mutation UpdateShotAnnotations(
$annotations: [UpdateAnnotationInputGQL!]!
) {
updateShotAnnotations(shotId: $shotId, annotations: $annotations) {
value {
... on SuccessfulUpdate {
value
shot {
id
annotations {
shotId
type {
id
name
}
notes
errorDefault
}
}
... on UpdateShotAnnotationErrors {
error {
shotId
msg
}
}
}
}
}
query GetShotsWithVideoGql($filterInput: FilterInput!, $limit: Int) {
getShotsWithMetadata(filterInput: $filterInput, limit: $limit) {

View File

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