Support for assigning any image from a gallery as the cover (#5053)

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
sezzim
2024-08-28 18:24:52 -07:00
committed by GitHub
parent 8133aa8c91
commit 68738bd227
23 changed files with 383 additions and 10 deletions

View File

@@ -1526,6 +1526,34 @@ export const mutateAddGalleryImages = (input: GQL.GalleryAddInput) =>
},
});
export const mutateSetGalleryCover = (input: GQL.GallerySetCoverInput) =>
client.mutate<GQL.SetGalleryCoverMutation>({
mutation: GQL.SetGalleryCoverDocument,
variables: input,
update(cache, result) {
if (!result.data?.setGalleryCover) return;
cache.evict({
id: cache.identify({ __typename: "Gallery", id: input.gallery_id }),
fieldName: "cover",
});
},
});
export const mutateResetGalleryCover = (input: GQL.GalleryResetCoverInput) =>
client.mutate<GQL.ResetGalleryCoverMutation>({
mutation: GQL.ResetGalleryCoverDocument,
variables: input,
update(cache, result) {
if (!result.data?.resetGalleryCover) return;
cache.evict({
id: cache.identify({ __typename: "Gallery", id: input.gallery_id }),
fieldName: "cover",
});
},
});
export const mutateRemoveGalleryImages = (input: GQL.GalleryRemoveInput) =>
client.mutate<GQL.RemoveGalleryImagesMutation>({
mutation: GQL.RemoveGalleryImagesDocument,