Add moveCookieToCategory mutation

Moving a cookie between categories previously required two sequential
updateCookieCategory mutations, which was not atomic and could leave
data in an inconsistent state if the second call failed. This adds a
dedicated moveCookieToCategory mutation that performs both updates in
a single transaction.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-21 10:34:17 +04:00
parent 1574600c72
commit 653b43fc81
5 changed files with 225 additions and 80 deletions

View File

@@ -172,6 +172,9 @@ extend type Mutation {
reorderCookieCategory(
input: ReorderCookieCategoryInput!
): ReorderCookieCategoryPayload!
moveCookieToCategory(
input: MoveCookieToCategoryInput!
): MoveCookieToCategoryPayload!
}
input CreateCookieBannerInput {
@@ -238,6 +241,12 @@ input CookieItemInput {
description: String!
}
input MoveCookieToCategoryInput {
sourceCookieCategoryId: ID!
targetCookieCategoryId: ID!
cookieName: String!
}
type CreateCookieBannerPayload {
cookieBannerEdge: CookieBannerEdge!
}
@@ -281,3 +290,9 @@ type DeleteCookieCategoryPayload {
type ReorderCookieCategoryPayload {
cookieBanner: CookieBanner!
}
type MoveCookieToCategoryPayload {
sourceCookieCategory: CookieCategory!
targetCookieCategory: CookieCategory!
cookieBanner: CookieBanner!
}