Skip to content

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

Update GraphQL schema

Marcin Gębaladaf96a14c44f
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index de78991a70..8c77312bca 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -269,7 +269,6 @@ type CategoryDelete {
input CategoryInput {
description: String
name: String
- parent: ID
slug: String
seo: SeoInput
backgroundImage: Upload
@@ -692,7 +691,7 @@ type Mutations {
attributeValueCreate(attribute: ID!, input: AttributeValueCreateInput!): AttributeValueCreate
attributeValueDelete(id: ID!): AttributeValueDelete
attributeValueUpdate(id: ID!, input: AttributeValueCreateInput!): AttributeValueUpdate
- categoryCreate(input: CategoryInput!): CategoryCreate
+ categoryCreate(input: CategoryInput!, parent: ID): CategoryCreate
categoryDelete(id: ID!): CategoryDelete
categoryUpdate(id: ID!, input: CategoryInput!): CategoryUpdate
customerCreate(input: UserCreateInput!): CustomerCreate
diff --git a/saleor/static/dashboard-next/categories/mutations.ts b/saleor/static/dashboard-next/categories/mutations.ts
index 244be96d08..89c8f9379f 100644
--- a/saleor/static/dashboard-next/categories/mutations.ts
+++ b/saleor/static/dashboard-next/categories/mutations.ts
@@ -32,8 +32,8 @@ export const TypedCategoryDeleteMutation = TypedMutation<
export const categoryCreateMutation = gql`
${categoryDetailsFragment}
- mutation CategoryCreate($input: CategoryInput!) {
- categoryCreate(input: $input) {
+ mutation CategoryCreate($parent: ID, $input: CategoryInput!) {
+ categoryCreate(parent: $parent, input: $input) {
errors {
field
message
diff --git a/saleor/static/dashboard-next/categories/types/CategoryCreate.ts b/saleor/static/dashboard-next/categories/types/CategoryCreate.ts
index e517628fda..559bd69bd1 100644
--- a/saleor/static/dashboard-next/categories/types/CategoryCreate.ts
+++ b/saleor/static/dashboard-next/categories/types/CategoryCreate.ts
@@ -25,7 +25,6 @@ export interface CategoryCreate_categoryCreate_category {
description: string;
seoDescription: string | null;
seoTitle: string | null;
- parent: CategoryCreate_categoryCreate_category_parent | null;
}
export interface CategoryCreate_categoryCreate {
@@ -39,5 +38,6 @@ export interface CategoryCreate {
}
export interface CategoryCreateVariables {
+ parent?: string | null;
input: CategoryInput;
}
diff --git a/saleor/static/dashboard-next/categories/types/CategoryUpdate.ts b/saleor/static/dashboard-next/categories/types/CategoryUpdate.ts
index 0c81b619b0..def6e63200 100644
--- a/saleor/static/dashboard-next/categories/types/CategoryUpdate.ts
+++ b/saleor/static/dashboard-next/categories/types/CategoryUpdate.ts
@@ -25,7 +25,6 @@ export interface CategoryUpdate_categoryUpdate_category {
description: string;
seoDescription: string | null;
seoTitle: string | null;
- parent: CategoryUpdate_categoryUpdate_category_parent | null;
}
export interface CategoryUpdate_categoryUpdate {
diff --git a/saleor/static/dashboard-next/categories/views/CategoryCreate.tsx b/saleor/static/dashboard-next/categories/views/CategoryCreate.tsx
index 5fb8e544df..a1e29afc38 100644
--- a/saleor/static/dashboard-next/categories/views/CategoryCreate.tsx
+++ b/saleor/static/dashboard-next/categories/views/CategoryCreate.tsx
@@ -43,12 +43,12 @@ export const CategoryCreateView: React.StatelessComponent<
input: {
description: formData.description,
name: formData.name,
- parent: parentId,
seo: {
description: formData.seoDescription,
title: formData.seoTitle
}
- }
+ },
+ parent: parentId
}
})
}
diff --git a/saleor/static/dashboard-next/types/globalTypes.ts b/saleor/static/dashboard-next/types/globalTypes.ts
index e63b52a630..580f508caa 100644
--- a/saleor/static/dashboard-next/types/globalTypes.ts
+++ b/saleor/static/dashboard-next/types/globalTypes.ts
@@ -155,7 +155,6 @@ export interface AuthorizationKeyInput {
export interface CategoryInput {
description?: string | null;
name?: string | null;
- parent?: string | null;
slug?: string | null;
seo?: SeoInput | null;
}