Add reorderCookieCategory mutation
Category reordering previously required two separate updateCookieCategory calls to swap ranks, which was not atomic. Replace with a single reorderCookieCategory mutation that shifts all affected ranks in one SQL statement, and remove the rank field from UpdateCookieCategoryInput. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -169,6 +169,9 @@ extend type Mutation {
|
||||
deleteCookieCategory(
|
||||
input: DeleteCookieCategoryInput!
|
||||
): DeleteCookieCategoryPayload!
|
||||
reorderCookieCategory(
|
||||
input: ReorderCookieCategoryInput!
|
||||
): ReorderCookieCategoryPayload!
|
||||
}
|
||||
|
||||
input CreateCookieBannerInput {
|
||||
@@ -218,7 +221,6 @@ input UpdateCookieCategoryInput {
|
||||
cookieCategoryId: ID!
|
||||
name: String
|
||||
description: String
|
||||
rank: Int
|
||||
cookies: [CookieItemInput!]
|
||||
}
|
||||
|
||||
@@ -226,6 +228,11 @@ input DeleteCookieCategoryInput {
|
||||
cookieCategoryId: ID!
|
||||
}
|
||||
|
||||
input ReorderCookieCategoryInput {
|
||||
cookieCategoryId: ID!
|
||||
rank: Int!
|
||||
}
|
||||
|
||||
input CookieItemInput {
|
||||
name: String!
|
||||
duration: String!
|
||||
@@ -271,3 +278,7 @@ type DeleteCookieCategoryPayload {
|
||||
deletedCookieCategoryId: ID!
|
||||
cookieBanner: CookieBanner!
|
||||
}
|
||||
|
||||
type ReorderCookieCategoryPayload {
|
||||
cookieBanner: CookieBanner!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user