Skip to content

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

Fix missing SEO fields in Product mutations

Simon Brulhart9b170563d563
diff --git a/saleor/static/dashboard-next/products/mutations.ts b/saleor/static/dashboard-next/products/mutations.ts
index b8845d331e..ef7024d690 100644
--- a/saleor/static/dashboard-next/products/mutations.ts
+++ b/saleor/static/dashboard-next/products/mutations.ts
@@ -124,6 +124,7 @@ export const productUpdateMutation = gql`
$isPublished: Boolean!
$name: String
$basePrice: Decimal
+ $seo: SeoInput
) {
productUpdate(
id: $id
@@ -137,6 +138,7 @@ export const productUpdateMutation = gql`
isPublished: $isPublished
name: $name
basePrice: $basePrice
+ seo: $seo
}
) {
errors {
@@ -170,6 +172,7 @@ export const simpleProductUpdateMutation = gql`
$basePrice: Decimal
$productVariantId: ID!
$productVariantInput: ProductVariantInput!
+ $seo: SeoInput
) {
productUpdate(
id: $id
@@ -183,6 +186,7 @@ export const simpleProductUpdateMutation = gql`
isPublished: $isPublished
name: $name
basePrice: $basePrice
+ seo: $seo
}
) {
errors {
@@ -224,6 +228,7 @@ export const productCreateMutation = gql`
$productType: ID!
$sku: String
$stockQuantity: Int
+ $seo: SeoInput
) {
productCreate(
input: {
@@ -239,6 +244,7 @@ export const productCreateMutation = gql`
productType: $productType
sku: $sku
quantity: $stockQuantity
+ seo: $seo
}
) {
errors {
diff --git a/saleor/static/dashboard-next/products/types/ProductCreate.ts b/saleor/static/dashboard-next/products/types/ProductCreate.ts
index 2ea0479573..5688b7287e 100644
--- a/saleor/static/dashboard-next/products/types/ProductCreate.ts
+++ b/saleor/static/dashboard-next/products/types/ProductCreate.ts
@@ -2,7 +2,7 @@
/* eslint-disable */
// This file was automatically generated and should not be edited.
-import { AttributeValueInput } from "./../../types/globalTypes";
+import { AttributeValueInput, SeoInput } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: ProductCreate
@@ -196,4 +196,5 @@ export interface ProductCreateVariables {
productType: string;
sku?: string | null;
stockQuantity?: number | null;
+ seo?: SeoInput | null;
}
diff --git a/saleor/static/dashboard-next/products/types/ProductUpdate.ts b/saleor/static/dashboard-next/products/types/ProductUpdate.ts
index 0b8795836c..b991242e01 100644
--- a/saleor/static/dashboard-next/products/types/ProductUpdate.ts
+++ b/saleor/static/dashboard-next/products/types/ProductUpdate.ts
@@ -2,7 +2,7 @@
/* eslint-disable */
// This file was automatically generated and should not be edited.
-import { AttributeValueInput } from "./../../types/globalTypes";
+import { AttributeValueInput, SeoInput } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: ProductUpdate
@@ -194,4 +194,5 @@ export interface ProductUpdateVariables {
isPublished: boolean;
name?: string | null;
basePrice?: any | null;
+ seo?: SeoInput | null;
}
diff --git a/saleor/static/dashboard-next/products/types/SimpleProductUpdate.ts b/saleor/static/dashboard-next/products/types/SimpleProductUpdate.ts
index 66563c9aa9..5b0b3d69b7 100644
--- a/saleor/static/dashboard-next/products/types/SimpleProductUpdate.ts
+++ b/saleor/static/dashboard-next/products/types/SimpleProductUpdate.ts
@@ -2,7 +2,7 @@
/* eslint-disable */
// This file was automatically generated and should not be edited.
-import { AttributeValueInput, ProductVariantInput } from "./../../types/globalTypes";
+import { AttributeValueInput, ProductVariantInput, SeoInput } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: SimpleProductUpdate
@@ -305,4 +305,5 @@ export interface SimpleProductUpdateVariables {
basePrice?: any | null;
productVariantId: string;
productVariantInput: ProductVariantInput;
+ seo?: SeoInput | null;
}
diff --git a/saleor/static/dashboard-next/products/views/ProductCreate.tsx b/saleor/static/dashboard-next/products/views/ProductCreate.tsx
index 7a996113af..d0258e494c 100644
--- a/saleor/static/dashboard-next/products/views/ProductCreate.tsx
+++ b/saleor/static/dashboard-next/products/views/ProductCreate.tsx
@@ -75,6 +75,10 @@ export const ProductUpdate: React.StatelessComponent<
formData.publicationDate !== ""
? formData.publicationDate
: null,
+ seo: {
+ description: formData.seoDescription,
+ title: formData.seoTitle,
+ },
sku: formData.sku,
stockQuantity:
formData.stockQuantity !== null
diff --git a/saleor/static/dashboard-next/products/views/ProductUpdate.tsx b/saleor/static/dashboard-next/products/views/ProductUpdate.tsx
index ed8cd8ccc6..f36eb9ffa2 100644
--- a/saleor/static/dashboard-next/products/views/ProductUpdate.tsx
+++ b/saleor/static/dashboard-next/products/views/ProductUpdate.tsx
@@ -135,7 +135,11 @@ export const ProductUpdate: React.StatelessComponent<ProductUpdateProps> = ({
publicationDate:
data.publicationDate !== ""
? data.publicationDate
- : null
+ : null,
+ seo: {
+ description: data.seoDescription,
+ title: data.seoTitle,
+ }
});
} else {
updateSimpleProduct.mutate({
@@ -158,7 +162,11 @@ export const ProductUpdate: React.StatelessComponent<ProductUpdateProps> = ({
publicationDate:
data.publicationDate !== ""
? data.publicationDate
- : null
+ : null,
+ seo: {
+ description: data.seoDescription,
+ title: data.seoTitle,
+ }
});
}
}