diff --git a/schema.graphql b/schema.graphql index 0cf0146af..26f6aa664 100644 --- a/schema.graphql +++ b/schema.graphql @@ -322,6 +322,13 @@ input AttributeSortingInput { direction: OrderDirection! } +type AttributeTranslatableContent implements Node { + id: ID! + name: String! + translation(languageCode: LanguageCodeEnum!): AttributeTranslation + attribute: Attribute +} + type AttributeTranslate { errors: [Error!] attribute: Attribute @@ -414,6 +421,13 @@ input AttributeValueInput { values: [String]! } +type AttributeValueTranslatableContent implements Node { + id: ID! + name: String! + translation(languageCode: LanguageCodeEnum!): AttributeValueTranslation + attributeValue: AttributeValue +} + type AttributeValueTranslate { errors: [Error!] attributeValue: AttributeValue @@ -486,9 +500,9 @@ type Category implements Node { seoDescription: String id: ID! name: String! - slug: String! description: String! descriptionJson: JSONString! + slug: String! parent: Category level: Int! privateMeta: [MetaStore]! @@ -556,6 +570,17 @@ input CategoryInput { backgroundImageAlt: String } +type CategoryTranslatableContent implements Node { + seoTitle: String + seoDescription: String + id: ID! + name: String! + description: String! + descriptionJson: JSONString! + translation(languageCode: LanguageCodeEnum!): CategoryTranslation + category: Category +} + type CategoryTranslate { errors: [Error!] category: Category @@ -809,15 +834,15 @@ type ChoiceValue { } type Collection implements Node { - publicationDate: Date - isPublished: Boolean! seoTitle: String seoDescription: String id: ID! name: String! - slug: String! description: String! descriptionJson: JSONString! + publicationDate: Date + isPublished: Boolean! + slug: String! privateMeta: [MetaStore]! meta: [MetaStore]! products(before: String, after: String, first: Int, last: Int): ProductCountableConnection @@ -925,6 +950,17 @@ type CollectionReorderProducts { productErrors: [ProductError!] } +type CollectionTranslatableContent implements Node { + seoTitle: String + seoDescription: String + id: ID! + name: String! + description: String! + descriptionJson: JSONString! + translation(languageCode: LanguageCodeEnum!): CollectionTranslation + collection: Collection +} + type CollectionTranslate { errors: [Error!] collection: Collection @@ -968,7 +1004,7 @@ type ConfigurationItem { input ConfigurationItemInput { name: String! - value: String! + value: String } enum ConfigurationTypeFieldEnum { @@ -1483,6 +1519,7 @@ input DraftOrderCreateInput { shippingAddress: AddressInput shippingMethod: ID voucher: ID + customerNote: String lines: [OrderLineCreateInput] } @@ -1500,6 +1537,7 @@ input DraftOrderInput { shippingAddress: AddressInput shippingMethod: ID voucher: ID + customerNote: String } type DraftOrderLineDelete { @@ -1560,7 +1598,7 @@ type Fulfillment implements Node { fulfillmentOrder: Int! status: FulfillmentStatus! trackingNumber: String! - shippingDate: DateTime! + created: DateTime! privateMeta: [MetaStore]! meta: [MetaStore]! lines: [FulfillmentLine] @@ -1876,9 +1914,9 @@ input MenuInput { type MenuItem implements Node { id: ID! + name: String! sortOrder: Int @deprecated(reason: "Will be dropped in 2.10 and is deprecated since 2.9: use the position in list instead and relative calculus to determine shift position.") menu: Menu! - name: String! parent: MenuItem category: Category collection: Collection @@ -1952,6 +1990,13 @@ input MenuItemMoveInput { sortOrder: Int } +type MenuItemTranslatableContent implements Node { + id: ID! + name: String! + translation(languageCode: LanguageCodeEnum!): MenuItemTranslation + menuItem: MenuItem +} + type MenuItemTranslate { errors: [Error!] menuItem: MenuItem @@ -2006,7 +2051,7 @@ type MetaStore { type Money { currency: String! amount: Float! - localized: String! + localized: String! @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.11. Price formatting according to the current locale should be handled by the frontend client.") } type MoneyRange { @@ -2586,15 +2631,15 @@ type OrderVoid { } type Page implements Node { - publicationDate: Date - isPublished: Boolean! seoTitle: String seoDescription: String id: ID! - slug: String! title: String! content: String! contentJson: JSONString! + publicationDate: Date + isPublished: Boolean! + slug: String! created: DateTime! translation(languageCode: LanguageCodeEnum!): PageTranslation } @@ -2651,9 +2696,20 @@ input PageInput { seo: SeoInput } +type PageTranslatableContent implements Node { + seoTitle: String + seoDescription: String + id: ID! + title: String! + content: String! + contentJson: JSONString! + translation(languageCode: LanguageCodeEnum!): PageTranslation + page: Page +} + type PageTranslate { errors: [Error!] - page: Page + page: PageTranslatableContent } type PageTranslation implements Node { @@ -2854,15 +2910,15 @@ input PriceRangeInput { type Product implements Node { id: ID! - publicationDate: Date - isPublished: Boolean! seoTitle: String seoDescription: String - productType: ProductType! name: String! description: String! descriptionJson: JSONString! - category: Category! + publicationDate: Date + isPublished: Boolean! + productType: ProductType! + category: Category updatedAt: DateTime chargeTaxes: Boolean! weight: Weight @@ -2979,6 +3035,7 @@ input ProductFilterInput { isPublished: Boolean collections: [ID] categories: [ID] + hasCategory: Boolean price: PriceRangeInput attributes: [AttributeInput] stockAvailability: StockAvailability @@ -3082,6 +3139,17 @@ type ProductPricingInfo { priceRangeLocalCurrency: TaxedMoneyRange } +type ProductTranslatableContent implements Node { + id: ID! + seoTitle: String + seoDescription: String + name: String! + description: String! + descriptionJson: JSONString! + translation(languageCode: LanguageCodeEnum!): ProductTranslation + product: Product +} + type ProductTranslate { errors: [Error!] product: Product @@ -3226,8 +3294,8 @@ type ProductUpdatePrivateMeta { type ProductVariant implements Node { id: ID! - sku: String! name: String! + sku: String! product: Product! trackInventory: Boolean! quantityAllocated: Int! @@ -3330,6 +3398,13 @@ input ProductVariantInput { weight: WeightScalar } +type ProductVariantTranslatableContent implements Node { + id: ID! + name: String! + translation(languageCode: LanguageCodeEnum!): ProductVariantTranslation + productVariant: ProductVariant +} + type ProductVariantTranslate { errors: [Error!] productVariant: ProductVariant @@ -3365,6 +3440,7 @@ type Query { webhookEvents: [WebhookEvent] webhookSamplePayload(eventType: WebhookEventTypeEnum!): JSONString translations(kind: TranslatableKinds!, before: String, after: String, first: Int, last: Int): TranslatableItemConnection + translation(id: ID!, kind: TranslatableKinds!): TranslatableItem shop: Shop shippingZone(id: ID!): ShippingZone shippingZones(before: String, after: String, first: Int, last: Int): ShippingZoneCountableConnection @@ -3418,7 +3494,6 @@ type Query { serviceAccounts(filter: ServiceAccountFilterInput, before: String, after: String, first: Int, last: Int): ServiceAccountCountableConnection serviceAccount(id: ID!): ServiceAccount user(id: ID!): User - node(id: ID!): Node _entities(representations: [_Any]): [_Entity] _service: _Service } @@ -3515,6 +3590,13 @@ type SaleRemoveCatalogues { sale: Sale } +type SaleTranslatableContent implements Node { + id: ID! + name: String! + translation(languageCode: LanguageCodeEnum!): SaleTranslation + sale: Sale +} + type SaleTranslate { errors: [Error!] sale: Sale @@ -3670,6 +3752,13 @@ type ShippingMethod implements Node { translation(languageCode: LanguageCodeEnum!): ShippingMethodTranslation } +type ShippingMethodTranslatableContent implements Node { + id: ID! + name: String! + translation(languageCode: LanguageCodeEnum!): ShippingMethodTranslation + shippingMethod: ShippingMethod +} + type ShippingMethodTranslation implements Node { id: ID! name: String @@ -4020,7 +4109,7 @@ enum TransactionKind { CONFIRM } -union TranslatableItem = Product | Category | Collection | Attribute | AttributeValue | ProductVariant | Page | ShippingMethod | Sale | Voucher | MenuItem +union TranslatableItem = ProductTranslatableContent | CollectionTranslatableContent | CategoryTranslatableContent | AttributeTranslatableContent | AttributeValueTranslatableContent | ProductVariantTranslatableContent | PageTranslatableContent | ShippingMethodTranslatableContent | SaleTranslatableContent | VoucherTranslatableContent | MenuItemTranslatableContent type TranslatableItemConnection { pageInfo: PageInfo! @@ -4190,8 +4279,8 @@ type VerifyToken { type Voucher implements Node { id: ID! - type: VoucherTypeEnum! name: String + type: VoucherTypeEnum! code: String! usageLimit: Int used: Int! @@ -4280,6 +4369,13 @@ type VoucherRemoveCatalogues { voucher: Voucher } +type VoucherTranslatableContent implements Node { + id: ID! + name: String + translation(languageCode: LanguageCodeEnum!): VoucherTranslation + voucher: Voucher +} + type VoucherTranslate { errors: [Error!] voucher: Voucher diff --git a/src/components/Navigator/queries/types/SearchCatalog.ts b/src/components/Navigator/queries/types/SearchCatalog.ts index 0fd38ea68..da0d4967c 100644 --- a/src/components/Navigator/queries/types/SearchCatalog.ts +++ b/src/components/Navigator/queries/types/SearchCatalog.ts @@ -49,7 +49,7 @@ export interface SearchCatalog_products_edges_node_category { export interface SearchCatalog_products_edges_node { __typename: "Product"; id: string; - category: SearchCatalog_products_edges_node_category; + category: SearchCatalog_products_edges_node_category | null; name: string; } diff --git a/src/products/types/Product.ts b/src/products/types/Product.ts index 35d5a5eba..92eb979ae 100644 --- a/src/products/types/Product.ts +++ b/src/products/types/Product.ts @@ -153,7 +153,7 @@ export interface Product { descriptionJson: any; seoTitle: string | null; seoDescription: string | null; - category: Product_category; + category: Product_category | null; collections: (Product_collections | null)[] | null; basePrice: Product_basePrice | null; margin: Product_margin | null; diff --git a/src/products/types/ProductCreate.ts b/src/products/types/ProductCreate.ts index bb2706b5f..3f9632436 100644 --- a/src/products/types/ProductCreate.ts +++ b/src/products/types/ProductCreate.ts @@ -159,7 +159,7 @@ export interface ProductCreate_productCreate_product { descriptionJson: any; seoTitle: string | null; seoDescription: string | null; - category: ProductCreate_productCreate_product_category; + category: ProductCreate_productCreate_product_category | null; collections: (ProductCreate_productCreate_product_collections | null)[] | null; basePrice: ProductCreate_productCreate_product_basePrice | null; margin: ProductCreate_productCreate_product_margin | null; diff --git a/src/products/types/ProductDetails.ts b/src/products/types/ProductDetails.ts index 3ed43c47a..8e6833036 100644 --- a/src/products/types/ProductDetails.ts +++ b/src/products/types/ProductDetails.ts @@ -168,7 +168,7 @@ export interface ProductDetails_product { descriptionJson: any; seoTitle: string | null; seoDescription: string | null; - category: ProductDetails_product_category; + category: ProductDetails_product_category | null; collections: (ProductDetails_product_collections | null)[] | null; basePrice: ProductDetails_product_basePrice | null; margin: ProductDetails_product_margin | null; diff --git a/src/products/types/ProductImageCreate.ts b/src/products/types/ProductImageCreate.ts index db1c34871..8f52fb568 100644 --- a/src/products/types/ProductImageCreate.ts +++ b/src/products/types/ProductImageCreate.ts @@ -159,7 +159,7 @@ export interface ProductImageCreate_productImageCreate_product { descriptionJson: any; seoTitle: string | null; seoDescription: string | null; - category: ProductImageCreate_productImageCreate_product_category; + category: ProductImageCreate_productImageCreate_product_category | null; collections: (ProductImageCreate_productImageCreate_product_collections | null)[] | null; basePrice: ProductImageCreate_productImageCreate_product_basePrice | null; margin: ProductImageCreate_productImageCreate_product_margin | null; diff --git a/src/products/types/ProductImageUpdate.ts b/src/products/types/ProductImageUpdate.ts index 045296fa0..1f5ae6984 100644 --- a/src/products/types/ProductImageUpdate.ts +++ b/src/products/types/ProductImageUpdate.ts @@ -159,7 +159,7 @@ export interface ProductImageUpdate_productImageUpdate_product { descriptionJson: any; seoTitle: string | null; seoDescription: string | null; - category: ProductImageUpdate_productImageUpdate_product_category; + category: ProductImageUpdate_productImageUpdate_product_category | null; collections: (ProductImageUpdate_productImageUpdate_product_collections | null)[] | null; basePrice: ProductImageUpdate_productImageUpdate_product_basePrice | null; margin: ProductImageUpdate_productImageUpdate_product_margin | null; diff --git a/src/products/types/ProductUpdate.ts b/src/products/types/ProductUpdate.ts index 97189239a..10fb5078b 100644 --- a/src/products/types/ProductUpdate.ts +++ b/src/products/types/ProductUpdate.ts @@ -159,7 +159,7 @@ export interface ProductUpdate_productUpdate_product { descriptionJson: any; seoTitle: string | null; seoDescription: string | null; - category: ProductUpdate_productUpdate_product_category; + category: ProductUpdate_productUpdate_product_category | null; collections: (ProductUpdate_productUpdate_product_collections | null)[] | null; basePrice: ProductUpdate_productUpdate_product_basePrice | null; margin: ProductUpdate_productUpdate_product_margin | null; diff --git a/src/products/types/SimpleProductUpdate.ts b/src/products/types/SimpleProductUpdate.ts index d958ad3c3..62ea4240f 100644 --- a/src/products/types/SimpleProductUpdate.ts +++ b/src/products/types/SimpleProductUpdate.ts @@ -159,7 +159,7 @@ export interface SimpleProductUpdate_productUpdate_product { descriptionJson: any; seoTitle: string | null; seoDescription: string | null; - category: SimpleProductUpdate_productUpdate_product_category; + category: SimpleProductUpdate_productUpdate_product_category | null; collections: (SimpleProductUpdate_productUpdate_product_collections | null)[] | null; basePrice: SimpleProductUpdate_productUpdate_product_basePrice | null; margin: SimpleProductUpdate_productUpdate_product_margin | null; diff --git a/src/translations/mutations.ts b/src/translations/mutations.ts index 149f72a50..8328208ec 100644 --- a/src/translations/mutations.ts +++ b/src/translations/mutations.ts @@ -4,7 +4,7 @@ import { TypedMutation } from "../mutations"; import { categoryTranslationFragment, collectionTranslationFragment, - pageTranslationFragment, + pageTranslatableFragment, productTranslationFragment, saleTranslationFragment, voucherTranslationFragment @@ -112,7 +112,7 @@ export const TypedUpdateCollectionTranslations = TypedMutation< >(updateCollectionTranslations); const updatePageTranslations = gql` - ${pageTranslationFragment} + ${pageTranslatableFragment} mutation UpdatePageTranslations( $id: ID! $input: PageTranslationInput! @@ -124,7 +124,7 @@ const updatePageTranslations = gql` message } page { - ...PageTranslationFragment + ...PageTranslatableFragment } } } diff --git a/src/translations/queries.ts b/src/translations/queries.ts index f63d72960..19b977379 100644 --- a/src/translations/queries.ts +++ b/src/translations/queries.ts @@ -179,6 +179,27 @@ export const pageTranslationFragment = gql` } } `; +export const pageTranslatableFragment = gql` + fragment PageTranslatableFragment on PageTranslatableContent { + id + contentJson + seoDescription + seoTitle + title + + translation(languageCode: $language) { + id + contentJson + seoDescription + seoTitle + title + language { + code + language + } + } + } +`; export const productTypeTranslationFragment = gql` fragment AttributeTranslationFragment on Attribute { id diff --git a/src/translations/types/PageTranslatableFragment.ts b/src/translations/types/PageTranslatableFragment.ts new file mode 100644 index 000000000..dc214e951 --- /dev/null +++ b/src/translations/types/PageTranslatableFragment.ts @@ -0,0 +1,35 @@ +/* tslint:disable */ +/* eslint-disable */ +// This file was automatically generated and should not be edited. + +import { LanguageCodeEnum } from "./../../types/globalTypes"; + +// ==================================================== +// GraphQL fragment: PageTranslatableFragment +// ==================================================== + +export interface PageTranslatableFragment_translation_language { + __typename: "LanguageDisplay"; + code: LanguageCodeEnum; + language: string; +} + +export interface PageTranslatableFragment_translation { + __typename: "PageTranslation"; + id: string; + contentJson: any; + seoDescription: string | null; + seoTitle: string | null; + title: string; + language: PageTranslatableFragment_translation_language; +} + +export interface PageTranslatableFragment { + __typename: "PageTranslatableContent"; + id: string; + contentJson: any; + seoDescription: string | null; + seoTitle: string | null; + title: string; + translation: PageTranslatableFragment_translation | null; +} diff --git a/src/translations/types/UpdatePageTranslations.ts b/src/translations/types/UpdatePageTranslations.ts index 020ef5c04..1034ee761 100644 --- a/src/translations/types/UpdatePageTranslations.ts +++ b/src/translations/types/UpdatePageTranslations.ts @@ -31,7 +31,7 @@ export interface UpdatePageTranslations_pageTranslate_page_translation { } export interface UpdatePageTranslations_pageTranslate_page { - __typename: "Page"; + __typename: "PageTranslatableContent"; id: string; contentJson: any; seoDescription: string | null; diff --git a/src/types/globalTypes.ts b/src/types/globalTypes.ts index 44ec52260..045577709 100644 --- a/src/types/globalTypes.ts +++ b/src/types/globalTypes.ts @@ -698,7 +698,7 @@ export interface CollectionInput { export interface ConfigurationItemInput { name: string; - value: string; + value?: string | null; } export interface CustomerFilterInput { @@ -737,6 +737,7 @@ export interface DraftOrderInput { shippingAddress?: AddressInput | null; shippingMethod?: string | null; voucher?: string | null; + customerNote?: string | null; } export interface FulfillmentCancelInput { @@ -870,6 +871,7 @@ export interface ProductFilterInput { isPublished?: boolean | null; collections?: (string | null)[] | null; categories?: (string | null)[] | null; + hasCategory?: boolean | null; price?: PriceRangeInput | null; attributes?: (AttributeInput | null)[] | null; stockAvailability?: StockAvailability | null;