Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Update changelog and deprecate menuItem.sortOrder

NyanKiyoshi8a7170fafdd5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3539d8519a..2e3391f614 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -72,6 +72,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Add error codes to mutations responses - #4676 by @Kwaidan00
- Payment gateways are now saleor plugins with dynamic configuration - #4669 by @salwator
+- Unified MenuItemMove to other reordering mutations. It now uses relative positions instead of absolute ones (breaking change) - #4734 by @NyanKiyoshi.
## 2.8.0
### Core
diff --git a/saleor/graphql/menu/types.py b/saleor/graphql/menu/types.py
index 5a67139bbe..20509aa6e0 100644
--- a/saleor/graphql/menu/types.py
+++ b/saleor/graphql/menu/types.py
@@ -54,6 +54,14 @@ class MenuItem(CountableDjangoObjectType):
resolver=resolve_translation,
)
+ sort_order = graphene.Field(
+ graphene.Int,
+ deprecation_reason=(
+ "Use the position in list instead and relative "
+ "calculus to determine shift position."
+ ),
+ )
+
class Meta:
description = """Represents a single item of the related menu.
Can store categories, collection or pages."""
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index f086b8d379..08b1632bc9 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -1840,7 +1840,7 @@ input MenuInput {
type MenuItem implements Node {
id: ID!
- sortOrder: Int
+ sortOrder: Int @deprecated(reason: "Use the position in list instead and relative calculus to determine shift position.")
menu: Menu!
name: String!
parent: MenuItem