diff --git a/cypress/e2e/products/productsVariants.js b/cypress/e2e/products/productsVariants.js index 8aad6d9cc..fa29f7fa2 100644 --- a/cypress/e2e/products/productsVariants.js +++ b/cypress/e2e/products/productsVariants.js @@ -163,7 +163,7 @@ describe("As an admin I should be able to create variant", () => { }); getProductVariants(createdProduct.id, defaultChannel.slug); }) - .then(([firstVariant, secondVariant]) => { + .then(([secondVariant, firstVariant]) => { expect(firstVariant).to.have.property("price", variants[0].price); expect(firstVariant).to.have.property("name", "value"); expect(firstVariant).to.have.property("currency", "USD"); diff --git a/introspection.json b/introspection.json index 4d847d263..31e4c9298 100644 --- a/introspection.json +++ b/introspection.json @@ -1121,6 +1121,178 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "privateMetadata", + "description": "List of private metadata items. Requires staff permissions to access.\n\nAdded in Saleor 3.10.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "MetadataItem", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "privateMetafield", + "description": "A single key from private metadata. Requires staff permissions to access.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.10.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [ + { + "name": "key", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "privateMetafields", + "description": "Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.10.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [ + { + "name": "keys", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "SCALAR", + "name": "Metadata", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metadata", + "description": "List of public metadata items. Can be accessed without permissions.\n\nAdded in Saleor 3.10.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "MetadataItem", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metafield", + "description": "A single key from public metadata.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.10.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [ + { + "name": "key", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metafields", + "description": "Public metadata. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.10.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [ + { + "name": "keys", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "SCALAR", + "name": "Metadata", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "firstName", "description": null, @@ -1324,6 +1496,11 @@ "kind": "INTERFACE", "name": "Node", "ofType": null + }, + { + "kind": "INTERFACE", + "name": "ObjectWithMetadata", + "ofType": null } ], "enumValues": null, @@ -6065,8 +6242,8 @@ "ofType": null } }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": true, + "deprecationReason": "This field will be removed in Saleor 4.0." }, { "name": "filterableInDashboard", @@ -6097,8 +6274,8 @@ "ofType": null } }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": true, + "deprecationReason": "This field will be removed in Saleor 4.0." }, { "name": "storefrontSearchPosition", @@ -6113,8 +6290,8 @@ "ofType": null } }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": true, + "deprecationReason": "This field will be removed in Saleor 4.0." }, { "name": "translation", @@ -6782,7 +6959,7 @@ }, { "name": "filterableInStorefront", - "description": "Whether the attribute can be filtered in storefront.", + "description": "Whether the attribute can be filtered in storefront.\n\nDEPRECATED: this field will be removed in Saleor 4.0.", "type": { "kind": "SCALAR", "name": "Boolean", @@ -6806,7 +6983,7 @@ }, { "name": "storefrontSearchPosition", - "description": "The position of the attribute in the storefront navigation (0 by default).", + "description": "The position of the attribute in the storefront navigation (0 by default).\n\nDEPRECATED: this field will be removed in Saleor 4.0.", "type": { "kind": "SCALAR", "name": "Int", @@ -6818,7 +6995,7 @@ }, { "name": "availableInGrid", - "description": "Whether the attribute can be displayed in the admin product list.", + "description": "Whether the attribute can be displayed in the admin product list.\n\nDEPRECATED: this field will be removed in Saleor 4.0.", "type": { "kind": "SCALAR", "name": "Boolean", @@ -7099,6 +7276,49 @@ ], "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "AttributeEntityTypeEnumFilterInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "eq", + "description": "The value equal to.", + "type": { + "kind": "ENUM", + "name": "AttributeEntityTypeEnum", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "oneOf", + "description": "The value included in.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "AttributeEntityTypeEnum", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "AttributeError", @@ -7572,6 +7792,49 @@ ], "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "AttributeInputTypeEnumFilterInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "eq", + "description": "The value equal to.", + "type": { + "kind": "ENUM", + "name": "AttributeInputTypeEnum", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "oneOf", + "description": "The value included in.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "AttributeInputTypeEnum", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "AttributeReorderValues", @@ -8000,6 +8263,49 @@ ], "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "AttributeTypeEnumFilterInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "eq", + "description": "The value equal to.", + "type": { + "kind": "ENUM", + "name": "AttributeTypeEnum", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "oneOf", + "description": "The value included in.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "AttributeTypeEnum", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "AttributeUpdate", @@ -8191,7 +8497,7 @@ }, { "name": "filterableInStorefront", - "description": "Whether the attribute can be filtered in storefront.", + "description": "Whether the attribute can be filtered in storefront.\n\nDEPRECATED: this field will be removed in Saleor 4.0.", "type": { "kind": "SCALAR", "name": "Boolean", @@ -8215,7 +8521,7 @@ }, { "name": "storefrontSearchPosition", - "description": "The position of the attribute in the storefront navigation (0 by default).", + "description": "The position of the attribute in the storefront navigation (0 by default).\n\nDEPRECATED: this field will be removed in Saleor 4.0.", "type": { "kind": "SCALAR", "name": "Int", @@ -8227,7 +8533,7 @@ }, { "name": "availableInGrid", - "description": "Whether the attribute can be displayed in the admin product list.", + "description": "Whether the attribute can be displayed in the admin product list.\n\nDEPRECATED: this field will be removed in Saleor 4.0.", "type": { "kind": "SCALAR", "name": "Boolean", @@ -9230,6 +9536,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "swatch", + "description": "Attribute value ID.\n\nAdded in Saleor 3.9.", + "type": { + "kind": "INPUT_OBJECT", + "name": "AttributeValueSelectableTypeInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "multiselect", "description": "List of attribute value IDs.\n\nAdded in Saleor 3.9.", @@ -9994,6 +10312,241 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "AttributeWhereInput", + "description": "Where filtering options.\n\nAdded in Saleor 3.11.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "fields": null, + "inputFields": [ + { + "name": "valueRequired", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "visibleInStorefront", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "filterableInDashboard", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metadata", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "MetadataFilter", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ids", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "StringFilterInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "slug", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "StringFilterInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "withChoices", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "inputType", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "AttributeInputTypeEnumFilterInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "entityType", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "AttributeEntityTypeEnumFilterInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "AttributeTypeEnumFilterInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "unit", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "MeasurementUnitsEnumFilterInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "inCollection", + "description": null, + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "inCategory", + "description": null, + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "AND", + "description": "List of conditions that must be met.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AttributeWhereInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OR", + "description": "A list of conditions of which at least one must be met.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AttributeWhereInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "INPUT_OBJECT", "name": "BulkAttributeValueInput", @@ -12575,6 +13128,22 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "orderSettings", + "description": "Channel-specific order settings.\n\nAdded in Saleor 3.12.\n\nRequires one of the following permissions: MANAGE_CHANNELS, MANAGE_ORDERS.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderSettings", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -12800,6 +13369,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "orderSettings", + "description": "The channel order settings\n\nAdded in Saleor 3.12.", + "type": { + "kind": "INPUT_OBJECT", + "name": "OrderSettingsInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "name", "description": "Name of the channel.", @@ -13348,6 +13929,69 @@ ], "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "ChannelListingUpdateInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "channelListing", + "description": "ID of a channel listing.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "price", + "description": "Price of the particular variant in channel.", + "type": { + "kind": "SCALAR", + "name": "PositiveDecimal", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "costPrice", + "description": "Cost price of the variant in channel.", + "type": { + "kind": "SCALAR", + "name": "PositiveDecimal", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "preorderThreshold", + "description": "The threshold for preorder variant in channel.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "ChannelReorderWarehouses", @@ -13475,7 +14119,7 @@ { "kind": "OBJECT", "name": "ChannelUpdate", - "description": "Update a channel. \n\nRequires one of the following permissions: MANAGE_CHANNELS.", + "description": "Update a channel.\n\nRequires one of the following permissions: MANAGE_CHANNELS.\nRequires one of the following permissions when updating only orderSettings field: MANAGE_CHANNELS, MANAGE_ORDERS.", "fields": [ { "name": "channelErrors", @@ -13613,6 +14257,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "orderSettings", + "description": "The channel order settings\n\nAdded in Saleor 3.12.", + "type": { + "kind": "INPUT_OBJECT", + "name": "OrderSettingsInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "name", "description": "Name of the channel.", @@ -15966,7 +16622,7 @@ }, { "name": "privateMetadata", - "description": "List of private metadata items. Requires staff permissions to access.", + "description": "List of private metadata items. Requires staff permissions to access.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", "args": [], "type": { "kind": "NON_NULL", @@ -15990,7 +16646,7 @@ }, { "name": "privateMetafield", - "description": "A single key from private metadata. Requires staff permissions to access.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "A single key from private metadata. Requires staff permissions to access.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", "args": [ { "name": "key", @@ -16019,7 +16675,7 @@ }, { "name": "privateMetafields", - "description": "Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", "args": [ { "name": "keys", @@ -16052,7 +16708,7 @@ }, { "name": "metadata", - "description": "List of public metadata items. Can be accessed without permissions.", + "description": "List of public metadata items. Can be accessed without permissions.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", "args": [], "type": { "kind": "NON_NULL", @@ -16076,7 +16732,7 @@ }, { "name": "metafield", - "description": "A single key from public metadata.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "A single key from public metadata.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", "args": [ { "name": "key", @@ -16105,7 +16761,7 @@ }, { "name": "metafields", - "description": "Public metadata. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "Public metadata. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", "args": [ { "name": "keys", @@ -25949,6 +26605,35 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "ENUM", + "name": "ErrorPolicyEnum", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "IGNORE_FAILED", + "description": "Save what is possible within a single row. If there are errors in an input data row, try to save it partially and skip the invalid part.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REJECT_EVERYTHING", + "description": "Reject all rows if there is at least one error in any of them.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REJECT_FAILED_ROWS", + "description": "Reject rows with errors.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, { "kind": "INTERFACE", "name": "Event", @@ -26402,6 +27087,21 @@ "name": "ProductDeleted", "ofType": null }, + { + "kind": "OBJECT", + "name": "ProductMediaCreated", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ProductMediaDeleted", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ProductMediaUpdated", + "ofType": null + }, { "kind": "OBJECT", "name": "ProductMetadataUpdated", @@ -26437,6 +27137,11 @@ "name": "ProductVariantOutOfStock", "ofType": null }, + { + "kind": "OBJECT", + "name": "ProductVariantStockUpdated", + "ofType": null + }, { "kind": "OBJECT", "name": "ProductVariantUpdated", @@ -26517,6 +27222,11 @@ "name": "StaffUpdated", "ofType": null }, + { + "kind": "OBJECT", + "name": "ThumbnailCreated", + "ofType": null + }, { "kind": "OBJECT", "name": "TransactionActionRequest", @@ -34383,6 +35093,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "order", + "description": "Order related to the invoice.\n\nAdded in Saleor 3.10.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Order", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -34655,6 +35377,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "order", + "description": "Order related to the invoice.\n\nAdded in Saleor 3.10.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Order", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -34996,6 +35730,22 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "order", + "description": "Order related to the invoice.\n\nAdded in Saleor 3.10.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Order", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -35144,6 +35894,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "order", + "description": "Order related to the invoice.\n\nAdded in Saleor 3.10.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Order", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -40684,6 +41446,49 @@ ], "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "MeasurementUnitsEnumFilterInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "eq", + "description": "The value equal to.", + "type": { + "kind": "ENUM", + "name": "MeasurementUnitsEnum", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "oneOf", + "description": "The value included in.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "MeasurementUnitsEnum", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "ENUM", "name": "MediaChoicesSortField", @@ -44211,7 +45016,7 @@ }, { "name": "webhookDryRun", - "description": "Performs a dry run of a webhook event. \n\nRequires one of the following permissions: MANAGE_APPS.", + "description": "Performs a dry run of a webhook event. Supports a single event (the first, if multiple provided in the `query`). Requires permission relevant to processed event.\n\nAdded in Saleor 3.11.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point. \n\nRequires one of the following permissions: AUTHENTICATED_STAFF_USER.", "args": [ { "name": "objectId", @@ -44256,7 +45061,7 @@ }, { "name": "webhookTrigger", - "description": "Trigger a webhook event. \n\nRequires one of the following permissions: MANAGE_APPS.", + "description": "Trigger a webhook event. Supports a single event (the first, if multiple provided in the `webhook.subscription_query`). Requires permission relevant to processed event. Successfully delivered webhook returns `delivery` with status='PENDING' and empty payload.\n\nAdded in Saleor 3.11.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point. \n\nRequires one of the following permissions: AUTHENTICATED_STAFF_USER.", "args": [ { "name": "objectId", @@ -45024,7 +45829,7 @@ }, { "name": "orderSettingsUpdate", - "description": "Update shop order settings. \n\nRequires one of the following permissions: MANAGE_ORDERS.", + "description": "Update shop order settings across all channels. Returns `orderSettings` for the first `channel` in alphabetical order. \n\nRequires one of the following permissions: MANAGE_ORDERS.", "args": [ { "name": "input", @@ -45048,8 +45853,8 @@ "name": "OrderSettingsUpdate", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": true, + "deprecationReason": "\n\nDEPRECATED: this mutation will be removed in Saleor 4.0. Use `channelUpdate` mutation instead." }, { "name": "giftCardSettingsUpdate", @@ -47357,6 +48162,18 @@ "name": "productVariantBulkCreate", "description": "Creates product variants for a given product. \n\nRequires one of the following permissions: MANAGE_PRODUCTS.", "args": [ + { + "name": "errorPolicy", + "description": "Policies of error handling. DEFAULT: REJECT_EVERYTHING\n\nAdded in Saleor 3.11.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "type": { + "kind": "ENUM", + "name": "ErrorPolicyEnum", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "product", "description": "ID of the product to create the variants for.", @@ -47406,6 +48223,71 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "productVariantBulkUpdate", + "description": "Update multiple product variants.\n\nAdded in Saleor 3.11.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point. \n\nRequires one of the following permissions: MANAGE_PRODUCTS.", + "args": [ + { + "name": "errorPolicy", + "description": "Policies of error handling. DEFAULT: REJECT_EVERYTHING", + "type": { + "kind": "ENUM", + "name": "ErrorPolicyEnum", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "product", + "description": "ID of the product to update the variants for.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "variants", + "description": "Input list of product variants to update.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ProductVariantBulkUpdateInput", + "ofType": null + } + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ProductVariantBulkUpdate", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "productVariantBulkDelete", "description": "Deletes product variants. \n\nRequires one of the following permissions: MANAGE_PRODUCTS.", @@ -53580,7 +54462,7 @@ }, { "name": "channelUpdate", - "description": "Update a channel. \n\nRequires one of the following permissions: MANAGE_CHANNELS.", + "description": "Update a channel.\n\nRequires one of the following permissions: MANAGE_CHANNELS.\nRequires one of the following permissions when updating only orderSettings field: MANAGE_CHANNELS, MANAGE_ORDERS.", "args": [ { "name": "id", @@ -56833,7 +57715,7 @@ }, { "name": "privateMetafield", - "description": "A single key from private metadata. Requires staff permissions to access.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "A single key from private metadata. Requires staff permissions to access.\n\nTip: Use GraphQL aliases to fetch multiple keys.", "args": [ { "name": "key", @@ -56862,7 +57744,7 @@ }, { "name": "privateMetafields", - "description": "Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything.", "args": [ { "name": "keys", @@ -56919,7 +57801,7 @@ }, { "name": "metafield", - "description": "A single key from public metadata.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "A single key from public metadata.\n\nTip: Use GraphQL aliases to fetch multiple keys.", "args": [ { "name": "key", @@ -56948,7 +57830,7 @@ }, { "name": "metafields", - "description": "Public metadata. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "Public metadata. Use `keys` to control which fields you want to include. The default is to include everything.", "args": [ { "name": "keys", @@ -56984,6 +57866,11 @@ "interfaces": [], "enumValues": null, "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Address", + "ofType": null + }, { "kind": "OBJECT", "name": "App", @@ -57074,6 +57961,11 @@ "name": "Product", "ofType": null }, + { + "kind": "OBJECT", + "name": "ProductMedia", + "ofType": null + }, { "kind": "OBJECT", "name": "ProductType", @@ -58368,6 +59260,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "checkoutId", + "description": "ID of the checkout that the order was created from. \n\nAdded in Saleor 3.11.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -61531,6 +62435,26 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "checkoutIds", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } ], "interfaces": null, @@ -62063,7 +62987,7 @@ }, { "name": "privateMetadata", - "description": "List of private metadata items. Requires staff permissions to access.", + "description": "List of private metadata items. Requires staff permissions to access.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", "args": [], "type": { "kind": "NON_NULL", @@ -62087,7 +63011,7 @@ }, { "name": "privateMetafield", - "description": "A single key from private metadata. Requires staff permissions to access.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "A single key from private metadata. Requires staff permissions to access.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", "args": [ { "name": "key", @@ -62116,7 +63040,7 @@ }, { "name": "privateMetafields", - "description": "Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", "args": [ { "name": "keys", @@ -62149,7 +63073,7 @@ }, { "name": "metadata", - "description": "List of public metadata items. Can be accessed without permissions.", + "description": "List of public metadata items. Can be accessed without permissions.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", "args": [], "type": { "kind": "NON_NULL", @@ -62173,7 +63097,7 @@ }, { "name": "metafield", - "description": "A single key from public metadata.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "A single key from public metadata.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", "args": [ { "name": "key", @@ -62202,7 +63126,7 @@ }, { "name": "metafields", - "description": "Public metadata. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "Public metadata. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", "args": [ { "name": "keys", @@ -63789,11 +64713,11 @@ { "kind": "OBJECT", "name": "OrderSettings", - "description": "Order related settings from site settings.", + "description": "Represents the channel-specific order settings.", "fields": [ { "name": "automaticallyConfirmAllNewOrders", - "description": null, + "description": "When disabled, all new orders from checkout will be marked as unconfirmed. When enabled orders from checkout will become unfulfilled immediately.", "args": [], "type": { "kind": "NON_NULL", @@ -63809,7 +64733,7 @@ }, { "name": "automaticallyFulfillNonShippableGiftCard", - "description": null, + "description": "When enabled, all non-shippable gift card orders will be fulfilled automatically.", "args": [], "type": { "kind": "NON_NULL", @@ -63897,10 +64821,45 @@ ], "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "OrderSettingsInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "automaticallyConfirmAllNewOrders", + "description": "When disabled, all new orders from checkout will be marked as unconfirmed. When enabled orders from checkout will become unfulfilled immediately. By default set to True", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "automaticallyFulfillNonShippableGiftCard", + "description": "When enabled, all non-shippable gift card orders will be fulfilled automatically. By defualt set to True.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "OrderSettingsUpdate", - "description": "Update shop order settings. \n\nRequires one of the following permissions: MANAGE_ORDERS.", + "description": "Update shop order settings across all channels. Returns `orderSettings` for the first `channel` in alphabetical order. \n\nRequires one of the following permissions: MANAGE_ORDERS.", "fields": [ { "name": "orderSettings", @@ -63976,7 +64935,7 @@ "inputFields": [ { "name": "automaticallyConfirmAllNewOrders", - "description": "When disabled, all new orders from checkout will be marked as unconfirmed. When enabled orders from checkout will become unfulfilled immediately.", + "description": "When disabled, all new orders from checkout will be marked as unconfirmed. When enabled orders from checkout will become unfulfilled immediately. By default set to True", "type": { "kind": "SCALAR", "name": "Boolean", @@ -63988,7 +64947,7 @@ }, { "name": "automaticallyFulfillNonShippableGiftCard", - "description": "When enabled, all non-shippable gift card orders will be fulfilled automatically.", + "description": "When enabled, all non-shippable gift card orders will be fulfilled automatically. By defualt set to True.", "type": { "kind": "SCALAR", "name": "Boolean", @@ -67091,6 +68050,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "where", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "AttributeWhereInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "before", "description": "Return the elements in the list that come before the specified cursor.", @@ -72199,7 +73170,7 @@ { "kind": "SCALAR", "name": "PositiveDecimal", - "description": "Positive Decimal scalar implementation.\n\nShould be used in places where value must be positive.", + "description": "Nonnegative Decimal scalar implementation.\n\nShould be used in places where value must be nonnegative (0 or greater).", "fields": null, "inputFields": null, "interfaces": null, @@ -73085,8 +74056,8 @@ "name": "ProductVariant", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": true, + "deprecationReason": "This field will be removed in Saleor 4.0. Use top-level `variant` query." }, { "name": "variants", @@ -75140,6 +76111,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "INVALID_PRICE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "PRODUCT_WITHOUT_CATEGORY", "description": null, @@ -75959,6 +76936,178 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "privateMetadata", + "description": "List of private metadata items. Requires staff permissions to access.\n\nAdded in Saleor 3.12.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "MetadataItem", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "privateMetafield", + "description": "A single key from private metadata. Requires staff permissions to access.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.12.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [ + { + "name": "key", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "privateMetafields", + "description": "Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.12.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [ + { + "name": "keys", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "SCALAR", + "name": "Metadata", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metadata", + "description": "List of public metadata items. Can be accessed without permissions.\n\nAdded in Saleor 3.12.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "MetadataItem", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metafield", + "description": "A single key from public metadata.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.12.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [ + { + "name": "key", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metafields", + "description": "Public metadata. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.12.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "args": [ + { + "name": "keys", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "SCALAR", + "name": "Metadata", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "sortOrder", "description": null, @@ -76059,6 +77208,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "productId", + "description": "Product id the media refers to.\n\nAdded in Saleor 3.12.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -76067,6 +77228,11 @@ "kind": "INTERFACE", "name": "Node", "ofType": null + }, + { + "kind": "INTERFACE", + "name": "ObjectWithMetadata", + "ofType": null } ], "enumValues": null, @@ -76293,6 +77459,83 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "ProductMediaCreated", + "description": "Event sent when new product media is created.\n\nAdded in Saleor 3.12.", + "fields": [ + { + "name": "issuedAt", + "description": "Time of the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "version", + "description": "Saleor version that triggered the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issuingPrincipal", + "description": "The user or application that triggered the event.", + "args": [], + "type": { + "kind": "UNION", + "name": "IssuingPrincipal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recipient", + "description": "The application receiving the webhook.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "App", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productMedia", + "description": "The product media the event relates to.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductMedia", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Event", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "ProductMediaDelete", @@ -76376,6 +77619,83 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "ProductMediaDeleted", + "description": "Event sent when product media is deleted.\n\nAdded in Saleor 3.12.", + "fields": [ + { + "name": "issuedAt", + "description": "Time of the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "version", + "description": "Saleor version that triggered the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issuingPrincipal", + "description": "The user or application that triggered the event.", + "args": [], + "type": { + "kind": "UNION", + "name": "IssuingPrincipal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recipient", + "description": "The application receiving the webhook.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "App", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productMedia", + "description": "The product media the event relates to.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductMedia", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Event", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "ProductMediaReorder", @@ -76596,6 +77916,83 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "ProductMediaUpdated", + "description": "Event sent when product media is updated.\n\nAdded in Saleor 3.12.", + "fields": [ + { + "name": "issuedAt", + "description": "Time of the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "version", + "description": "Saleor version that triggered the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issuingPrincipal", + "description": "The user or application that triggered the event.", + "args": [], + "type": { + "kind": "UNION", + "name": "IssuingPrincipal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recipient", + "description": "The application receiving the webhook.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "App", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productMedia", + "description": "The product media the event relates to.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductMedia", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Event", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "ProductMetadataUpdated", @@ -77911,6 +79308,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "where", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "AttributeWhereInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "before", "description": "Return the elements in the list that come before the specified cursor.", @@ -79823,7 +81232,7 @@ }, { "name": "productVariants", - "description": "List of the created variants.", + "description": "List of the created variants.This field will be removed in Saleor 4.0.", "args": [], "type": { "kind": "NON_NULL", @@ -79845,6 +81254,30 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "results", + "description": "List of the created variants.\n\nAdded in Saleor 3.11.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProductVariantBulkResult", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "bulkProductErrors", "description": null, @@ -80173,6 +81606,573 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "ProductVariantBulkError", + "description": null, + "fields": [ + { + "name": "field", + "description": "Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "message", + "description": "The error message.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "code", + "description": "The error code.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProductVariantBulkErrorCode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "attributes", + "description": "List of attributes IDs which causes the error.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "values", + "description": "List of attribute values IDs which causes the error.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "warehouses", + "description": "List of warehouse IDs which causes the error.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stocks", + "description": "List of stocks IDs which causes the error.\n\nAdded in Saleor 3.12.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "channels", + "description": "List of channel IDs which causes the error.\n\nAdded in Saleor 3.12.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "channelListings", + "description": "List of channel listings IDs which causes the error.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ProductVariantBulkErrorCode", + "description": "An enumeration.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ATTRIBUTE_ALREADY_ASSIGNED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ATTRIBUTE_CANNOT_BE_ASSIGNED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ATTRIBUTE_VARIANTS_DISABLED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DUPLICATED_INPUT_ITEM", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "GRAPHQL_ERROR", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INVALID", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INVALID_PRICE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NOT_PRODUCTS_VARIANT", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NOT_FOUND", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REQUIRED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNIQUE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PRODUCT_NOT_ASSIGNED_TO_CHANNEL", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductVariantBulkResult", + "description": null, + "fields": [ + { + "name": "productVariant", + "description": "Product variant data.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductVariant", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "errors", + "description": "List of errors occurred on create attempt.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProductVariantBulkError", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductVariantBulkUpdate", + "description": "Update multiple product variants.\n\nAdded in Saleor 3.11.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point. \n\nRequires one of the following permissions: MANAGE_PRODUCTS.", + "fields": [ + { + "name": "count", + "description": "Returns how many objects were updated.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "results", + "description": "List of the updated variants.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProductVariantBulkResult", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "errors", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProductVariantBulkError", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ProductVariantBulkUpdateInput", + "description": "Input fields to update product variants.\n\nAdded in Saleor 3.11.", + "fields": null, + "inputFields": [ + { + "name": "attributes", + "description": "List of attributes specific to this variant.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "BulkAttributeValueInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sku", + "description": "Stock keeping unit.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Variant name.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "trackInventory", + "description": "Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "weight", + "description": "Weight of the Product Variant.", + "type": { + "kind": "SCALAR", + "name": "WeightScalar", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "preorder", + "description": "Determines if variant is in preorder.\n\nAdded in Saleor 3.1.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "type": { + "kind": "INPUT_OBJECT", + "name": "PreorderSettingsInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantityLimitPerCustomer", + "description": "Determines maximum quantity of `ProductVariant`,that can be bought in a single checkout.\n\nAdded in Saleor 3.1.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metadata", + "description": "Fields required to update the product variant metadata.\n\nAdded in Saleor 3.8.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "MetadataInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "privateMetadata", + "description": "Fields required to update the product variant private metadata.\n\nAdded in Saleor 3.8.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "MetadataInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of this product variant.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stocks", + "description": "Stocks input.\n\nAdded in Saleor 3.12.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ProductVariantStocksUpdateInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "channelListings", + "description": "Channel listings input.\n\nAdded in Saleor 3.12.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ProductVariantChannelListingUpdateInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "ID of the product variant to update.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "ProductVariantChannelListing", @@ -80408,6 +82408,77 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "ProductVariantChannelListingUpdateInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "create", + "description": "List of channels to create variant channel listings.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ProductVariantChannelListingAddInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "update", + "description": "List of channel listings to update.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ChannelListingUpdateInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "remove", + "description": "List of channel listings to remove.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "ProductVariantCountableConnection", @@ -81785,6 +83856,108 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "ProductVariantStockUpdated", + "description": "Event sent when product variant stock is updated.\n\nAdded in Saleor 3.11.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "fields": [ + { + "name": "issuedAt", + "description": "Time of the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "version", + "description": "Saleor version that triggered the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issuingPrincipal", + "description": "The user or application that triggered the event.", + "args": [], + "type": { + "kind": "UNION", + "name": "IssuingPrincipal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recipient", + "description": "The application receiving the webhook.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "App", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productVariant", + "description": "The product variant the event relates to.", + "args": [ + { + "name": "channel", + "description": "Slug of a channel for which the data should be returned.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ProductVariant", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "warehouse", + "description": "Look up a warehouse.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Warehouse", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Event", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "ProductVariantStocksCreate", @@ -81998,6 +84171,77 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "ProductVariantStocksUpdateInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "create", + "description": "List of warehouses to create stocks.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "StockInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "update", + "description": "List of stocks to update.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "StockUpdateInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "remove", + "description": "List of stocks to remove.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "ProductVariantTranslatableContent", @@ -83184,15 +85428,15 @@ }, { "name": "orderSettings", - "description": "Order related settings from site settings.\n\nRequires one of the following permissions: MANAGE_ORDERS.", + "description": "Order related settings from site settings. Returns `orderSettings` for the first `channel` in alphabetical order.\n\nRequires one of the following permissions: MANAGE_ORDERS.", "args": [], "type": { "kind": "OBJECT", "name": "OrderSettings", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": true, + "deprecationReason": "This field will be removed in Saleor 4.0. Use the `channel` query to fetch the `orderSettings` field instead." }, { "name": "giftCardSettings", @@ -86285,6 +88529,30 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "where", + "description": "Filtering options for attributes.\n\nAdded in Saleor 3.11.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "type": { + "kind": "INPUT_OBJECT", + "name": "AttributeWhereInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "search", + "description": "Search attributes.\n\nAdded in Saleor 3.11.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "sortBy", "description": "Sorting options for attributes.", @@ -90310,7 +92578,7 @@ }, { "name": "privateMetafield", - "description": "A single key from private metadata. Requires staff permissions to access.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "A single key from private metadata. Requires staff permissions to access.\n\nTip: Use GraphQL aliases to fetch multiple keys.", "args": [ { "name": "key", @@ -90339,7 +92607,7 @@ }, { "name": "privateMetafields", - "description": "Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything.", "args": [ { "name": "keys", @@ -90396,7 +92664,7 @@ }, { "name": "metafield", - "description": "A single key from public metadata.\n\nTip: Use GraphQL aliases to fetch multiple keys.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "A single key from public metadata.\n\nTip: Use GraphQL aliases to fetch multiple keys.", "args": [ { "name": "key", @@ -90425,7 +92693,7 @@ }, { "name": "metafields", - "description": "Public metadata. Use `keys` to control which fields you want to include. The default is to include everything.\n\nAdded in Saleor 3.3.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "description": "Public metadata. Use `keys` to control which fields you want to include. The default is to include everything.", "args": [ { "name": "keys", @@ -97516,6 +99784,49 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "StockUpdateInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "stock", + "description": "Stock.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantity", + "description": "Quantity of items available for sell.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "ENUM", "name": "StorePaymentMethodEnum", @@ -97545,6 +99856,49 @@ ], "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "StringFilterInput", + "description": "Define the filtering options for string fields.\n\nAdded in Saleor 3.11.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", + "fields": null, + "inputFields": [ + { + "name": "eq", + "description": "The value equal to.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "oneOf", + "description": "The value included in.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "Subscription", @@ -100564,6 +102918,119 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "ThumbnailCreated", + "description": "Event sent when thumbnail is created.\n\nAdded in Saleor 3.12.", + "fields": [ + { + "name": "issuedAt", + "description": "Time of the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "version", + "description": "Saleor version that triggered the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "issuingPrincipal", + "description": "The user or application that triggered the event.", + "args": [], + "type": { + "kind": "UNION", + "name": "IssuingPrincipal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recipient", + "description": "The application receiving the webhook.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "App", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "Thumbnail id.\n\nAdded in Saleor 3.12.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "Thumbnail url.\n\nAdded in Saleor 3.12.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "objectId", + "description": "Object the thumbnail refers to.\n\nAdded in Saleor 3.12.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mediaUrl", + "description": "Original media url.\n\nAdded in Saleor 3.12.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Event", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, { "kind": "ENUM", "name": "ThumbnailFormatEnum", @@ -110262,7 +112729,7 @@ { "kind": "OBJECT", "name": "WebhookDryRun", - "description": "Performs a dry run of a webhook event. \n\nRequires one of the following permissions: MANAGE_APPS.", + "description": "Performs a dry run of a webhook event. Supports a single event (the first, if multiple provided in the `query`). Requires permission relevant to processed event.\n\nAdded in Saleor 3.11.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point. \n\nRequires one of the following permissions: AUTHENTICATED_STAFF_USER.", "fields": [ { "name": "payload", @@ -110388,6 +112855,36 @@ "description": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "TYPE_NOT_SUPPORTED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SYNTAX", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MISSING_SUBSCRIPTION", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNABLE_TO_PARSE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MISSING_EVENT", + "description": null, + "isDeprecated": false, + "deprecationReason": null } ], "possibleTypes": null @@ -110486,6 +112983,30 @@ "description": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "SYNTAX", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MISSING_SUBSCRIPTION", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNABLE_TO_PARSE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MISSING_EVENT", + "description": null, + "isDeprecated": false, + "deprecationReason": null } ], "possibleTypes": null @@ -110987,6 +113508,24 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "PRODUCT_MEDIA_CREATED", + "description": "A new product media is created.\n\nAdded in Saleor 3.12.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PRODUCT_MEDIA_UPDATED", + "description": "A product media is updated.\n\nAdded in Saleor 3.12.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PRODUCT_MEDIA_DELETED", + "description": "A product media is deleted.\n\nAdded in Saleor 3.12.", + "isDeprecated": false, + "deprecationReason": null + }, { "name": "PRODUCT_METADATA_UPDATED", "description": "A product metadata is updated.\n\nAdded in Saleor 3.8.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", @@ -111023,6 +113562,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "PRODUCT_VARIANT_STOCK_UPDATED", + "description": "A product variant stock is updated", + "isDeprecated": false, + "deprecationReason": null + }, { "name": "PRODUCT_VARIANT_METADATA_UPDATED", "description": "A product variant metadata is updated.\n\nAdded in Saleor 3.8.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", @@ -111268,6 +113813,12 @@ "description": "An observability event is created.", "isDeprecated": false, "deprecationReason": null + }, + { + "name": "THUMBNAIL_CREATED", + "description": "A thumbnail is created.\n\nAdded in Saleor 3.12.", + "isDeprecated": false, + "deprecationReason": null } ], "possibleTypes": null @@ -111640,6 +114191,24 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "PRODUCT_MEDIA_CREATED", + "description": "A new product media is created.\n\nAdded in Saleor 3.12.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PRODUCT_MEDIA_UPDATED", + "description": "A product media is updated.\n\nAdded in Saleor 3.12.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PRODUCT_MEDIA_DELETED", + "description": "A product media is deleted.\n\nAdded in Saleor 3.12.", + "isDeprecated": false, + "deprecationReason": null + }, { "name": "PRODUCT_METADATA_UPDATED", "description": "A product metadata is updated.\n\nAdded in Saleor 3.8.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", @@ -111676,6 +114245,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "PRODUCT_VARIANT_STOCK_UPDATED", + "description": "A product variant stock is updated", + "isDeprecated": false, + "deprecationReason": null + }, { "name": "PRODUCT_VARIANT_METADATA_UPDATED", "description": "A product variant metadata is updated.\n\nAdded in Saleor 3.8.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", @@ -111922,6 +114497,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "THUMBNAIL_CREATED", + "description": "A thumbnail is created.\n\nAdded in Saleor 3.12.", + "isDeprecated": false, + "deprecationReason": null + }, { "name": "PAYMENT_AUTHORIZE", "description": "Authorize payment.", @@ -112442,6 +115023,24 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "PRODUCT_MEDIA_CREATED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PRODUCT_MEDIA_UPDATED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PRODUCT_MEDIA_DELETED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "PRODUCT_METADATA_UPDATED", "description": null, @@ -112478,6 +115077,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "PRODUCT_VARIANT_STOCK_UPDATED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "PRODUCT_VARIANT_METADATA_UPDATED", "description": null, @@ -112723,6 +115328,12 @@ "description": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "THUMBNAIL_CREATED", + "description": null, + "isDeprecated": false, + "deprecationReason": null } ], "possibleTypes": null @@ -112730,7 +115341,7 @@ { "kind": "OBJECT", "name": "WebhookTrigger", - "description": "Trigger a webhook event. \n\nRequires one of the following permissions: MANAGE_APPS.", + "description": "Trigger a webhook event. Supports a single event (the first, if multiple provided in the `webhook.subscription_query`). Requires permission relevant to processed event. Successfully delivered webhook returns `delivery` with status='PENDING' and empty payload.\n\nAdded in Saleor 3.11.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point. \n\nRequires one of the following permissions: AUTHENTICATED_STAFF_USER.", "fields": [ { "name": "delivery", @@ -112857,11 +115468,41 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "TYPE_NOT_SUPPORTED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SYNTAX", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MISSING_SUBSCRIPTION", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNABLE_TO_PARSE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "MISSING_QUERY", "description": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "MISSING_EVENT", + "description": null, + "isDeprecated": false, + "deprecationReason": null } ], "possibleTypes": null diff --git a/schema.graphql b/schema.graphql index c590fcbf8..a7cd2673b 100644 --- a/schema.graphql +++ b/schema.graphql @@ -185,8 +185,66 @@ type AccountUpdate { } """Represents user address data.""" -type Address implements Node { +type Address implements Node & ObjectWithMetadata { id: ID! + + """ + List of private metadata items. Requires staff permissions to access. + + Added in Saleor 3.10. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + privateMetadata: [MetadataItem!]! + + """ + A single key from private metadata. Requires staff permissions to access. + + Tip: Use GraphQL aliases to fetch multiple keys. + + Added in Saleor 3.10. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + privateMetafield(key: String!): String + + """ + Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything. + + Added in Saleor 3.10. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + privateMetafields(keys: [String!]): Metadata + + """ + List of public metadata items. Can be accessed without permissions. + + Added in Saleor 3.10. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + metadata: [MetadataItem!]! + + """ + A single key from public metadata. + + Tip: Use GraphQL aliases to fetch multiple keys. + + Added in Saleor 3.10. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + metafield(key: String!): String + + """ + Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. + + Added in Saleor 3.10. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + metafields(keys: [String!]): Metadata firstName: String! lastName: String! companyName: String! @@ -1170,7 +1228,7 @@ type Attribute implements Node & ObjectWithMetadata { """ Whether the attribute can be filtered in storefront. Requires one of the following permissions: MANAGE_PAGES, MANAGE_PAGE_TYPES_AND_ATTRIBUTES, MANAGE_PRODUCTS, MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. """ - filterableInStorefront: Boolean! + filterableInStorefront: Boolean! @deprecated(reason: "This field will be removed in Saleor 4.0.") """ Whether the attribute can be filtered in dashboard. Requires one of the following permissions: MANAGE_PAGES, MANAGE_PAGE_TYPES_AND_ATTRIBUTES, MANAGE_PRODUCTS, MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. @@ -1180,12 +1238,12 @@ type Attribute implements Node & ObjectWithMetadata { """ Whether the attribute can be displayed in the admin product list. Requires one of the following permissions: MANAGE_PAGES, MANAGE_PAGE_TYPES_AND_ATTRIBUTES, MANAGE_PRODUCTS, MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. """ - availableInGrid: Boolean! + availableInGrid: Boolean! @deprecated(reason: "This field will be removed in Saleor 4.0.") """ The position of the attribute in the storefront navigation (0 by default). Requires one of the following permissions: MANAGE_PAGES, MANAGE_PAGE_TYPES_AND_ATTRIBUTES, MANAGE_PRODUCTS, MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. """ - storefrontSearchPosition: Int! + storefrontSearchPosition: Int! @deprecated(reason: "This field will be removed in Saleor 4.0.") """Returns translated attribute fields for the given language code.""" translation( @@ -1313,7 +1371,11 @@ input AttributeCreateInput { """Whether the attribute should be visible or not in storefront.""" visibleInStorefront: Boolean - """Whether the attribute can be filtered in storefront.""" + """ + Whether the attribute can be filtered in storefront. + + DEPRECATED: this field will be removed in Saleor 4.0. + """ filterableInStorefront: Boolean """Whether the attribute can be filtered in dashboard.""" @@ -1321,10 +1383,16 @@ input AttributeCreateInput { """ The position of the attribute in the storefront navigation (0 by default). + + DEPRECATED: this field will be removed in Saleor 4.0. """ storefrontSearchPosition: Int - """Whether the attribute can be displayed in the admin product list.""" + """ + Whether the attribute can be displayed in the admin product list. + + DEPRECATED: this field will be removed in Saleor 4.0. + """ availableInGrid: Boolean """ @@ -1401,6 +1469,14 @@ enum AttributeEntityTypeEnum { PRODUCT_VARIANT } +input AttributeEntityTypeEnumFilterInput { + """The value equal to.""" + eq: AttributeEntityTypeEnum + + """The value included in.""" + oneOf: [AttributeEntityTypeEnum!] +} + type AttributeError { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. @@ -1484,6 +1560,14 @@ enum AttributeInputTypeEnum { DATE_TIME } +input AttributeInputTypeEnumFilterInput { + """The value equal to.""" + eq: AttributeInputTypeEnum + + """The value included in.""" + oneOf: [AttributeInputTypeEnum!] +} + """ Reorder the values of an attribute. @@ -1574,6 +1658,14 @@ enum AttributeTypeEnum { PAGE_TYPE } +input AttributeTypeEnumFilterInput { + """The value equal to.""" + eq: AttributeTypeEnum + + """The value included in.""" + oneOf: [AttributeTypeEnum!] +} + """ Updates attribute. @@ -1610,7 +1702,11 @@ input AttributeUpdateInput { """Whether the attribute should be visible or not in storefront.""" visibleInStorefront: Boolean - """Whether the attribute can be filtered in storefront.""" + """ + Whether the attribute can be filtered in storefront. + + DEPRECATED: this field will be removed in Saleor 4.0. + """ filterableInStorefront: Boolean """Whether the attribute can be filtered in dashboard.""" @@ -1618,10 +1714,16 @@ input AttributeUpdateInput { """ The position of the attribute in the storefront navigation (0 by default). + + DEPRECATED: this field will be removed in Saleor 4.0. """ storefrontSearchPosition: Int - """Whether the attribute can be displayed in the admin product list.""" + """ + Whether the attribute can be displayed in the admin product list. + + DEPRECATED: this field will be removed in Saleor 4.0. + """ availableInGrid: Boolean """ @@ -1878,6 +1980,13 @@ input AttributeValueInput { """ dropdown: AttributeValueSelectableTypeInput + """ + Attribute value ID. + + Added in Saleor 3.9. + """ + swatch: AttributeValueSelectableTypeInput + """ List of attribute value IDs. @@ -2082,6 +2191,36 @@ type AttributeValueUpdated implements Event { attributeValue: AttributeValue } +""" +Where filtering options. + +Added in Saleor 3.11. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +input AttributeWhereInput { + valueRequired: Boolean + visibleInStorefront: Boolean + filterableInDashboard: Boolean + metadata: [MetadataFilter!] + ids: [ID!] + name: StringFilterInput + slug: StringFilterInput + withChoices: Boolean + inputType: AttributeInputTypeEnumFilterInput + entityType: AttributeEntityTypeEnumFilterInput + type: AttributeTypeEnumFilterInput + unit: MeasurementUnitsEnumFilterInput + inCollection: ID + inCategory: ID + + """List of conditions that must be met.""" + AND: [AttributeWhereInput!] + + """A list of conditions of which at least one must be met.""" + OR: [AttributeWhereInput!] +} + input BulkAttributeValueInput { """ID of the selected attribute.""" id: ID @@ -2711,6 +2850,15 @@ type Channel implements Node { Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_STAFF_USER. """ stockSettings: StockSettings! + + """ + Channel-specific order settings. + + Added in Saleor 3.12. + + Requires one of the following permissions: MANAGE_CHANNELS, MANAGE_ORDERS. + """ + orderSettings: OrderSettings! } """ @@ -2761,6 +2909,13 @@ input ChannelCreateInput { """ addWarehouses: [ID!] + """ + The channel order settings + + Added in Saleor 3.12. + """ + orderSettings: OrderSettingsInput + """Name of the channel.""" name: String! @@ -2888,6 +3043,20 @@ enum ChannelErrorCode { DUPLICATED_INPUT_ITEM } +input ChannelListingUpdateInput { + """ID of a channel listing.""" + channelListing: ID! + + """Price of the particular variant in channel.""" + price: PositiveDecimal + + """Cost price of the variant in channel.""" + costPrice: PositiveDecimal + + """The threshold for preorder variant in channel.""" + preorderThreshold: Int +} + """ Reorder the warehouses of a channel. @@ -2928,9 +3097,10 @@ type ChannelStatusChanged implements Event { } """ -Update a channel. +Update a channel. Requires one of the following permissions: MANAGE_CHANNELS. +Requires one of the following permissions when updating only orderSettings field: MANAGE_CHANNELS, MANAGE_ORDERS. """ type ChannelUpdate { channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") @@ -2963,6 +3133,13 @@ input ChannelUpdateInput { """ addWarehouses: [ID!] + """ + The channel order settings + + Added in Saleor 3.12. + """ + orderSettings: OrderSettingsInput + """Name of the channel.""" name: String @@ -3461,7 +3638,13 @@ type CheckoutLanguageCodeUpdate { type CheckoutLine implements Node & ObjectWithMetadata { id: ID! - """List of private metadata items. Requires staff permissions to access.""" + """ + List of private metadata items. Requires staff permissions to access. + + Added in Saleor 3.5. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ privateMetadata: [MetadataItem!]! """ @@ -3469,7 +3652,7 @@ type CheckoutLine implements Node & ObjectWithMetadata { Tip: Use GraphQL aliases to fetch multiple keys. - Added in Saleor 3.3. + Added in Saleor 3.5. Note: this API is currently in Feature Preview and can be subject to changes at later point. """ @@ -3478,13 +3661,19 @@ type CheckoutLine implements Node & ObjectWithMetadata { """ Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything. - Added in Saleor 3.3. + Added in Saleor 3.5. Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata - """List of public metadata items. Can be accessed without permissions.""" + """ + List of public metadata items. Can be accessed without permissions. + + Added in Saleor 3.5. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ metadata: [MetadataItem!]! """ @@ -3492,7 +3681,7 @@ type CheckoutLine implements Node & ObjectWithMetadata { Tip: Use GraphQL aliases to fetch multiple keys. - Added in Saleor 3.3. + Added in Saleor 3.5. Note: this API is currently in Feature Preview and can be subject to changes at later point. """ @@ -3501,7 +3690,7 @@ type CheckoutLine implements Node & ObjectWithMetadata { """ Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. - Added in Saleor 3.3. + Added in Saleor 3.5. Note: this API is currently in Feature Preview and can be subject to changes at later point. """ @@ -5561,6 +5750,19 @@ type DraftOrderUpdated implements Event { order: Order } +enum ErrorPolicyEnum { + """ + Save what is possible within a single row. If there are errors in an input data row, try to save it partially and skip the invalid part. + """ + IGNORE_FAILED + + """Reject all rows if there is at least one error in any of them.""" + REJECT_EVERYTHING + + """Reject rows with errors.""" + REJECT_FAILED_ROWS +} + interface Event { """Time of the event.""" issuedAt: DateTime @@ -7358,6 +7560,13 @@ type Invoice implements ObjectWithMetadata & Job & Node { """URL to download an invoice.""" url: String + + """ + Order related to the invoice. + + Added in Saleor 3.10. + """ + order: Order } """ @@ -7412,6 +7621,13 @@ type InvoiceDeleted implements Event { """The invoice the event relates to.""" invoice: Invoice + + """ + Order related to the invoice. + + Added in Saleor 3.10. + """ + order: Order } type InvoiceError { @@ -7485,6 +7701,13 @@ type InvoiceRequested implements Event { """The invoice the event relates to.""" invoice: Invoice + + """ + Order related to the invoice. + + Added in Saleor 3.10. + """ + order: Order! } """ @@ -7520,6 +7743,13 @@ type InvoiceSent implements Event { """The invoice the event relates to.""" invoice: Invoice + + """ + Order related to the invoice. + + Added in Saleor 3.10. + """ + order: Order } """ @@ -8444,6 +8674,14 @@ enum MeasurementUnitsEnum { TONNE } +input MeasurementUnitsEnumFilterInput { + """The value equal to.""" + eq: MeasurementUnitsEnum + + """The value included in.""" + oneOf: [MeasurementUnitsEnum!] +} + enum MediaChoicesSortField { """Sort media by ID.""" ID @@ -9203,9 +9441,13 @@ type Mutation { ): EventDeliveryRetry """ - Performs a dry run of a webhook event. + Performs a dry run of a webhook event. Supports a single event (the first, if multiple provided in the `query`). Requires permission relevant to processed event. - Requires one of the following permissions: MANAGE_APPS. + Added in Saleor 3.11. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: AUTHENTICATED_STAFF_USER. """ webhookDryRun( """The ID of an object to serialize.""" @@ -9216,9 +9458,13 @@ type Mutation { ): WebhookDryRun """ - Trigger a webhook event. + Trigger a webhook event. Supports a single event (the first, if multiple provided in the `webhook.subscription_query`). Requires permission relevant to processed event. Successfully delivered webhook returns `delivery` with status='PENDING' and empty payload. - Requires one of the following permissions: MANAGE_APPS. + Added in Saleor 3.11. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: AUTHENTICATED_STAFF_USER. """ webhookTrigger( """The ID of an object to serialize.""" @@ -9483,14 +9729,14 @@ type Mutation { ): ShopAddressUpdate """ - Update shop order settings. + Update shop order settings across all channels. Returns `orderSettings` for the first `channel` in alphabetical order. Requires one of the following permissions: MANAGE_ORDERS. """ orderSettingsUpdate( """Fields required to update shop order settings.""" input: OrderSettingsUpdateInput! - ): OrderSettingsUpdate + ): OrderSettingsUpdate @deprecated(reason: "\n\nDEPRECATED: this mutation will be removed in Saleor 4.0. Use `channelUpdate` mutation instead.") """ Update gift card settings. @@ -10167,6 +10413,15 @@ type Mutation { Requires one of the following permissions: MANAGE_PRODUCTS. """ productVariantBulkCreate( + """ + Policies of error handling. DEFAULT: REJECT_EVERYTHING + + Added in Saleor 3.11. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + errorPolicy: ErrorPolicyEnum + """ID of the product to create the variants for.""" product: ID! @@ -10174,6 +10429,26 @@ type Mutation { variants: [ProductVariantBulkCreateInput!]! ): ProductVariantBulkCreate + """ + Update multiple product variants. + + Added in Saleor 3.11. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + + Requires one of the following permissions: MANAGE_PRODUCTS. + """ + productVariantBulkUpdate( + """Policies of error handling. DEFAULT: REJECT_EVERYTHING""" + errorPolicy: ErrorPolicyEnum + + """ID of the product to update the variants for.""" + product: ID! + + """Input list of product variants to update.""" + variants: [ProductVariantBulkUpdateInput!]! + ): ProductVariantBulkUpdate + """ Deletes product variants. @@ -12202,9 +12477,10 @@ type Mutation { ): ChannelCreate """ - Update a channel. + Update a channel. Requires one of the following permissions: MANAGE_CHANNELS. + Requires one of the following permissions when updating only orderSettings field: MANAGE_CHANNELS, MANAGE_ORDERS. """ channelUpdate( """ID of a channel to update.""" @@ -13046,19 +13322,11 @@ interface ObjectWithMetadata { A single key from private metadata. Requires staff permissions to access. Tip: Use GraphQL aliases to fetch multiple keys. - - Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String """ Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything. - - Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -13069,19 +13337,11 @@ interface ObjectWithMetadata { A single key from public metadata. Tip: Use GraphQL aliases to fetch multiple keys. - - Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String """ Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. - - Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata } @@ -13385,6 +13645,13 @@ type Order implements Node & ObjectWithMetadata { Added in Saleor 3.10. """ externalReference: String + + """ + ID of the checkout that the order was created from. + + Added in Saleor 3.11. + """ + checkoutId: ID } enum OrderAction { @@ -14017,6 +14284,7 @@ input OrderFilterInput { giftCardUsed: Boolean giftCardBought: Boolean numbers: [String!] + checkoutIds: [ID!] } """ @@ -14153,7 +14421,13 @@ type OrderFullyPaid implements Event { type OrderLine implements Node & ObjectWithMetadata { id: ID! - """List of private metadata items. Requires staff permissions to access.""" + """ + List of private metadata items. Requires staff permissions to access. + + Added in Saleor 3.5. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ privateMetadata: [MetadataItem!]! """ @@ -14161,7 +14435,7 @@ type OrderLine implements Node & ObjectWithMetadata { Tip: Use GraphQL aliases to fetch multiple keys. - Added in Saleor 3.3. + Added in Saleor 3.5. Note: this API is currently in Feature Preview and can be subject to changes at later point. """ @@ -14170,13 +14444,19 @@ type OrderLine implements Node & ObjectWithMetadata { """ Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything. - Added in Saleor 3.3. + Added in Saleor 3.5. Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata - """List of public metadata items. Can be accessed without permissions.""" + """ + List of public metadata items. Can be accessed without permissions. + + Added in Saleor 3.5. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ metadata: [MetadataItem!]! """ @@ -14184,7 +14464,7 @@ type OrderLine implements Node & ObjectWithMetadata { Tip: Use GraphQL aliases to fetch multiple keys. - Added in Saleor 3.3. + Added in Saleor 3.5. Note: this API is currently in Feature Preview and can be subject to changes at later point. """ @@ -14193,7 +14473,7 @@ type OrderLine implements Node & ObjectWithMetadata { """ Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. - Added in Saleor 3.3. + Added in Saleor 3.5. Note: this API is currently in Feature Preview and can be subject to changes at later point. """ @@ -14531,9 +14811,16 @@ input OrderReturnProductsInput { refund: Boolean = false } -"""Order related settings from site settings.""" +"""Represents the channel-specific order settings.""" type OrderSettings { + """ + When disabled, all new orders from checkout will be marked as unconfirmed. When enabled orders from checkout will become unfulfilled immediately. + """ automaticallyConfirmAllNewOrders: Boolean! + + """ + When enabled, all non-shippable gift card orders will be fulfilled automatically. + """ automaticallyFulfillNonShippableGiftCard: Boolean! } @@ -14555,8 +14842,20 @@ enum OrderSettingsErrorCode { INVALID } +input OrderSettingsInput { + """ + When disabled, all new orders from checkout will be marked as unconfirmed. When enabled orders from checkout will become unfulfilled immediately. By default set to True + """ + automaticallyConfirmAllNewOrders: Boolean + + """ + When enabled, all non-shippable gift card orders will be fulfilled automatically. By defualt set to True. + """ + automaticallyFulfillNonShippableGiftCard: Boolean +} + """ -Update shop order settings. +Update shop order settings across all channels. Returns `orderSettings` for the first `channel` in alphabetical order. Requires one of the following permissions: MANAGE_ORDERS. """ @@ -14569,12 +14868,12 @@ type OrderSettingsUpdate { input OrderSettingsUpdateInput { """ - When disabled, all new orders from checkout will be marked as unconfirmed. When enabled orders from checkout will become unfulfilled immediately. + When disabled, all new orders from checkout will be marked as unconfirmed. When enabled orders from checkout will become unfulfilled immediately. By default set to True """ automaticallyConfirmAllNewOrders: Boolean """ - When enabled, all non-shippable gift card orders will be fulfilled automatically. + When enabled, all non-shippable gift card orders will be fulfilled automatically. By defualt set to True. """ automaticallyFulfillNonShippableGiftCard: Boolean } @@ -15295,6 +15594,7 @@ type PageType implements Node & ObjectWithMetadata { """ availableAttributes( filter: AttributeFilterInput + where: AttributeWhereInput """Return the elements in the list that come before the specified cursor.""" before: String @@ -16396,9 +16696,9 @@ input PluginUpdateInput { } """ -Positive Decimal scalar implementation. +Nonnegative Decimal scalar implementation. -Should be used in places where value must be positive. +Should be used in places where value must be nonnegative (0 or greater). """ scalar PositiveDecimal @@ -16621,7 +16921,7 @@ type Product implements Node & ObjectWithMetadata { """SKU of the variant.""" sku: String - ): ProductVariant + ): ProductVariant @deprecated(reason: "This field will be removed in Saleor 4.0. Use top-level `variant` query.") """ List of variants for the product. Requires the following permissions to include the unpublished items: MANAGE_ORDERS, MANAGE_DISCOUNTS, MANAGE_PRODUCTS. @@ -17111,6 +17411,7 @@ enum ProductErrorCode { DUPLICATED_INPUT_ITEM GRAPHQL_ERROR INVALID + INVALID_PRICE PRODUCT_WITHOUT_CATEGORY NOT_PRODUCTS_IMAGE NOT_PRODUCTS_VARIANT @@ -17305,8 +17606,66 @@ input ProductInput { } """Represents a product media.""" -type ProductMedia implements Node { +type ProductMedia implements Node & ObjectWithMetadata { id: ID! + + """ + List of private metadata items. Requires staff permissions to access. + + Added in Saleor 3.12. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + privateMetadata: [MetadataItem!]! + + """ + A single key from private metadata. Requires staff permissions to access. + + Tip: Use GraphQL aliases to fetch multiple keys. + + Added in Saleor 3.12. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + privateMetafield(key: String!): String + + """ + Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything. + + Added in Saleor 3.12. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + privateMetafields(keys: [String!]): Metadata + + """ + List of public metadata items. Can be accessed without permissions. + + Added in Saleor 3.12. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + metadata: [MetadataItem!]! + + """ + A single key from public metadata. + + Tip: Use GraphQL aliases to fetch multiple keys. + + Added in Saleor 3.12. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + metafield(key: String!): String + + """ + Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. + + Added in Saleor 3.12. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + metafields(keys: [String!]): Metadata sortOrder: Int alt: String! type: ProductMediaType! @@ -17326,6 +17685,13 @@ type ProductMedia implements Node { """ format: ThumbnailFormatEnum ): String! + + """ + Product id the media refers to. + + Added in Saleor 3.12. + """ + productId: ID } """ @@ -17366,6 +17732,28 @@ input ProductMediaCreateInput { mediaUrl: String } +""" +Event sent when new product media is created. + +Added in Saleor 3.12. +""" +type ProductMediaCreated implements Event { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The product media the event relates to.""" + productMedia: ProductMedia +} + """ Deletes a product media. @@ -17378,6 +17766,28 @@ type ProductMediaDelete { errors: [ProductError!]! } +""" +Event sent when product media is deleted. + +Added in Saleor 3.12. +""" +type ProductMediaDeleted implements Event { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The product media the event relates to.""" + productMedia: ProductMedia +} + """ Changes ordering of the product media. @@ -17413,6 +17823,28 @@ input ProductMediaUpdateInput { alt: String } +""" +Event sent when product media is updated. + +Added in Saleor 3.12. +""" +type ProductMediaUpdated implements Event { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The product media the event relates to.""" + productMedia: ProductMedia +} + """ Event sent when product metadata is updated. @@ -17770,6 +18202,7 @@ type ProductType implements Node & ObjectWithMetadata { """ availableAttributes( filter: AttributeFilterInput + where: AttributeWhereInput """Return the elements in the list that come before the specified cursor.""" before: String @@ -18204,8 +18637,15 @@ type ProductVariantBulkCreate { """Returns how many objects were created.""" count: Int! - """List of the created variants.""" + """List of the created variants.This field will be removed in Saleor 4.0.""" productVariants: [ProductVariant!]! + + """ + List of the created variants. + + Added in Saleor 3.11. + """ + results: [ProductVariantBulkResult!]! bulkProductErrors: [BulkProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") errors: [BulkProductError!]! } @@ -18286,6 +18726,171 @@ type ProductVariantBulkDelete { errors: [ProductError!]! } +type ProductVariantBulkError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """The error message.""" + message: String + + """The error code.""" + code: ProductVariantBulkErrorCode! + + """List of attributes IDs which causes the error.""" + attributes: [ID!] + + """List of attribute values IDs which causes the error.""" + values: [ID!] + + """List of warehouse IDs which causes the error.""" + warehouses: [ID!] + + """ + List of stocks IDs which causes the error. + + Added in Saleor 3.12. + """ + stocks: [ID!] + + """ + List of channel IDs which causes the error. + + Added in Saleor 3.12. + """ + channels: [ID!] + + """List of channel listings IDs which causes the error.""" + channelListings: [ID!] +} + +"""An enumeration.""" +enum ProductVariantBulkErrorCode { + ATTRIBUTE_ALREADY_ASSIGNED + ATTRIBUTE_CANNOT_BE_ASSIGNED + ATTRIBUTE_VARIANTS_DISABLED + DUPLICATED_INPUT_ITEM + GRAPHQL_ERROR + INVALID + INVALID_PRICE + NOT_PRODUCTS_VARIANT + NOT_FOUND + REQUIRED + UNIQUE + PRODUCT_NOT_ASSIGNED_TO_CHANNEL +} + +type ProductVariantBulkResult { + """Product variant data.""" + productVariant: ProductVariant + + """List of errors occurred on create attempt.""" + errors: [ProductVariantBulkError!] +} + +""" +Update multiple product variants. + +Added in Saleor 3.11. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: MANAGE_PRODUCTS. +""" +type ProductVariantBulkUpdate { + """Returns how many objects were updated.""" + count: Int! + + """List of the updated variants.""" + results: [ProductVariantBulkResult!]! + errors: [ProductVariantBulkError!]! +} + +""" +Input fields to update product variants. + +Added in Saleor 3.11. +""" +input ProductVariantBulkUpdateInput { + """List of attributes specific to this variant.""" + attributes: [BulkAttributeValueInput!] + + """Stock keeping unit.""" + sku: String + + """Variant name.""" + name: String + + """ + Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. + """ + trackInventory: Boolean + + """Weight of the Product Variant.""" + weight: WeightScalar + + """ + Determines if variant is in preorder. + + Added in Saleor 3.1. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + preorder: PreorderSettingsInput + + """ + Determines maximum quantity of `ProductVariant`,that can be bought in a single checkout. + + Added in Saleor 3.1. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + quantityLimitPerCustomer: Int + + """ + Fields required to update the product variant metadata. + + Added in Saleor 3.8. + """ + metadata: [MetadataInput!] + + """ + Fields required to update the product variant private metadata. + + Added in Saleor 3.8. + """ + privateMetadata: [MetadataInput!] + + """ + External ID of this product variant. + + Added in Saleor 3.10. + """ + externalReference: String + + """ + Stocks input. + + Added in Saleor 3.12. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + stocks: ProductVariantStocksUpdateInput + + """ + Channel listings input. + + Added in Saleor 3.12. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + channelListings: ProductVariantChannelListingUpdateInput + + """ID of the product variant to update.""" + id: ID! +} + """Represents product varaint channel listing.""" type ProductVariantChannelListing implements Node { id: ID! @@ -18344,6 +18949,17 @@ type ProductVariantChannelListingUpdate { errors: [ProductChannelListingError!]! } +input ProductVariantChannelListingUpdateInput { + """List of channels to create variant channel listings.""" + create: [ProductVariantChannelListingAddInput!] + + """List of channel listings to update.""" + update: [ChannelListingUpdateInput!] + + """List of channel listings to remove.""" + remove: [ID!] +} + type ProductVariantCountableConnection { """Pagination data for this connection.""" pageInfo: PageInfo! @@ -18686,6 +19302,36 @@ input ProductVariantSortingInput { field: ProductVariantSortField! } +""" +Event sent when product variant stock is updated. + +Added in Saleor 3.11. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +type ProductVariantStockUpdated implements Event { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """The product variant the event relates to.""" + productVariant( + """Slug of a channel for which the data should be returned.""" + channel: String + ): ProductVariant + + """Look up a warehouse.""" + warehouse: Warehouse +} + """ Creates stocks for product variant. @@ -18722,6 +19368,17 @@ type ProductVariantStocksUpdate { errors: [BulkStockError!]! } +input ProductVariantStocksUpdateInput { + """List of warehouses to create stocks.""" + create: [StockInput!] + + """List of stocks to update.""" + update: [StockUpdateInput!] + + """List of stocks to remove.""" + remove: [ID!] +} + type ProductVariantTranslatableContent implements Node { id: ID! name: String! @@ -19051,11 +19708,11 @@ type Query { shop: Shop! """ - Order related settings from site settings. + Order related settings from site settings. Returns `orderSettings` for the first `channel` in alphabetical order. Requires one of the following permissions: MANAGE_ORDERS. """ - orderSettings: OrderSettings + orderSettings: OrderSettings @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `channel` query to fetch the `orderSettings` field instead.") """ Gift card related settings from site settings. @@ -19988,6 +20645,24 @@ type Query { """Filtering options for attributes.""" filter: AttributeFilterInput + """ + Filtering options for attributes. + + Added in Saleor 3.11. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + where: AttributeWhereInput + + """ + Search attributes. + + Added in Saleor 3.11. + + Note: this API is currently in Feature Preview and can be subject to changes at later point. + """ + search: String + """Sorting options for attributes.""" sortBy: AttributeSortingInput @@ -20914,19 +21589,11 @@ type ShippingMethod implements Node & ObjectWithMetadata { A single key from private metadata. Requires staff permissions to access. Tip: Use GraphQL aliases to fetch multiple keys. - - Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafield(key: String!): String """ Private metadata. Requires staff permissions to access. Use `keys` to control which fields you want to include. The default is to include everything. - - Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ privateMetafields(keys: [String!]): Metadata @@ -20937,19 +21604,11 @@ type ShippingMethod implements Node & ObjectWithMetadata { A single key from public metadata. Tip: Use GraphQL aliases to fetch multiple keys. - - Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafield(key: String!): String """ Public metadata. Use `keys` to control which fields you want to include. The default is to include everything. - - Added in Saleor 3.3. - - Note: this API is currently in Feature Preview and can be subject to changes at later point. """ metafields(keys: [String!]): Metadata @@ -22575,6 +23234,14 @@ input StockSettingsInput { allocationStrategy: AllocationStrategyEnum! } +input StockUpdateInput { + """Stock.""" + stock: ID! + + """Quantity of items available for sell.""" + quantity: Int! +} + """Enum representing the type of a payment storage in a gateway.""" enum StorePaymentMethodEnum { """ @@ -22591,6 +23258,21 @@ enum StorePaymentMethodEnum { NONE } +""" +Define the filtering options for string fields. + +Added in Saleor 3.11. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. +""" +input StringFilterInput { + """The value equal to.""" + eq: String + + """The value included in.""" + oneOf: [String!] +} + type Subscription { """ Look up subscription event. @@ -23298,6 +23980,53 @@ type TaxedMoneyRange { stop: TaxedMoney } +""" +Event sent when thumbnail is created. + +Added in Saleor 3.12. +""" +type ThumbnailCreated implements Event { + """Time of the event.""" + issuedAt: DateTime + + """Saleor version that triggered the event.""" + version: String + + """The user or application that triggered the event.""" + issuingPrincipal: IssuingPrincipal + + """The application receiving the webhook.""" + recipient: App + + """ + Thumbnail id. + + Added in Saleor 3.12. + """ + id: ID + + """ + Thumbnail url. + + Added in Saleor 3.12. + """ + url: String + + """ + Object the thumbnail refers to. + + Added in Saleor 3.12. + """ + objectId: ID + + """ + Original media url. + + Added in Saleor 3.12. + """ + mediaUrl: String +} + """An enumeration.""" enum ThumbnailFormatEnum { WEBP @@ -25384,9 +26113,13 @@ type WebhookDelete { } """ -Performs a dry run of a webhook event. +Performs a dry run of a webhook event. Supports a single event (the first, if multiple provided in the `query`). Requires permission relevant to processed event. -Requires one of the following permissions: MANAGE_APPS. +Added in Saleor 3.11. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: AUTHENTICATED_STAFF_USER. """ type WebhookDryRun { """JSON payload, that would be sent out to webhook's target URL.""" @@ -25413,6 +26146,11 @@ enum WebhookDryRunErrorCode { NOT_FOUND INVALID_ID MISSING_PERMISSION + TYPE_NOT_SUPPORTED + SYNTAX + MISSING_SUBSCRIPTION + UNABLE_TO_PARSE + MISSING_EVENT } type WebhookError { @@ -25436,6 +26174,10 @@ enum WebhookErrorCode { REQUIRED UNIQUE DELETE_FAILED + SYNTAX + MISSING_SUBSCRIPTION + UNABLE_TO_PARSE + MISSING_EVENT } """Webhook event.""" @@ -25675,6 +26417,27 @@ enum WebhookEventTypeAsyncEnum { """A product is deleted.""" PRODUCT_DELETED + """ + A new product media is created. + + Added in Saleor 3.12. + """ + PRODUCT_MEDIA_CREATED + + """ + A product media is updated. + + Added in Saleor 3.12. + """ + PRODUCT_MEDIA_UPDATED + + """ + A product media is deleted. + + Added in Saleor 3.12. + """ + PRODUCT_MEDIA_DELETED + """ A product metadata is updated. @@ -25699,6 +26462,9 @@ enum WebhookEventTypeAsyncEnum { """A product variant is back in stock.""" PRODUCT_VARIANT_BACK_IN_STOCK + """A product variant stock is updated""" + PRODUCT_VARIANT_STOCK_UPDATED + """ A product variant metadata is updated. @@ -25865,6 +26631,13 @@ enum WebhookEventTypeAsyncEnum { """An observability event is created.""" OBSERVABILITY + + """ + A thumbnail is created. + + Added in Saleor 3.12. + """ + THUMBNAIL_CREATED } """Enum determining type of webhook.""" @@ -26077,6 +26850,27 @@ enum WebhookEventTypeEnum { """A product is deleted.""" PRODUCT_DELETED + """ + A new product media is created. + + Added in Saleor 3.12. + """ + PRODUCT_MEDIA_CREATED + + """ + A product media is updated. + + Added in Saleor 3.12. + """ + PRODUCT_MEDIA_UPDATED + + """ + A product media is deleted. + + Added in Saleor 3.12. + """ + PRODUCT_MEDIA_DELETED + """ A product metadata is updated. @@ -26101,6 +26895,9 @@ enum WebhookEventTypeEnum { """A product variant is back in stock.""" PRODUCT_VARIANT_BACK_IN_STOCK + """A product variant stock is updated""" + PRODUCT_VARIANT_STOCK_UPDATED + """ A product variant metadata is updated. @@ -26268,6 +27065,13 @@ enum WebhookEventTypeEnum { """An observability event is created.""" OBSERVABILITY + """ + A thumbnail is created. + + Added in Saleor 3.12. + """ + THUMBNAIL_CREATED + """Authorize payment.""" PAYMENT_AUTHORIZE @@ -26429,12 +27233,16 @@ enum WebhookSampleEventTypeEnum { PRODUCT_CREATED PRODUCT_UPDATED PRODUCT_DELETED + PRODUCT_MEDIA_CREATED + PRODUCT_MEDIA_UPDATED + PRODUCT_MEDIA_DELETED PRODUCT_METADATA_UPDATED PRODUCT_VARIANT_CREATED PRODUCT_VARIANT_UPDATED PRODUCT_VARIANT_DELETED PRODUCT_VARIANT_OUT_OF_STOCK PRODUCT_VARIANT_BACK_IN_STOCK + PRODUCT_VARIANT_STOCK_UPDATED PRODUCT_VARIANT_METADATA_UPDATED CHECKOUT_CREATED CHECKOUT_UPDATED @@ -26476,12 +27284,17 @@ enum WebhookSampleEventTypeEnum { VOUCHER_DELETED VOUCHER_METADATA_UPDATED OBSERVABILITY + THUMBNAIL_CREATED } """ -Trigger a webhook event. +Trigger a webhook event. Supports a single event (the first, if multiple provided in the `webhook.subscription_query`). Requires permission relevant to processed event. Successfully delivered webhook returns `delivery` with status='PENDING' and empty payload. -Requires one of the following permissions: MANAGE_APPS. +Added in Saleor 3.11. + +Note: this API is currently in Feature Preview and can be subject to changes at later point. + +Requires one of the following permissions: AUTHENTICATED_STAFF_USER. """ type WebhookTrigger { delivery: EventDelivery @@ -26507,7 +27320,12 @@ enum WebhookTriggerErrorCode { NOT_FOUND INVALID_ID MISSING_PERMISSION + TYPE_NOT_SUPPORTED + SYNTAX + MISSING_SUBSCRIPTION + UNABLE_TO_PARSE MISSING_QUERY + MISSING_EVENT } """ diff --git a/src/fragments/errors.ts b/src/fragments/errors.ts index 50761f8bd..55a7354e9 100644 --- a/src/fragments/errors.ts +++ b/src/fragments/errors.ts @@ -117,6 +117,17 @@ export const bulkProductErrorFragment = gql` message } `; +export const productVariantBulkError = gql` + fragment ProductVariantBulkError on ProductVariantBulkError { + field + code + message + attributes + values + warehouses + channels + } +`; export const bulkStockErrorFragment = gql` fragment BulkStockError on BulkStockError { code diff --git a/src/fragments/products.ts b/src/fragments/products.ts index 7d25e547a..7aed0d478 100644 --- a/src/fragments/products.ts +++ b/src/fragments/products.ts @@ -79,6 +79,7 @@ export const channelListingProductFragment = gql` export const channelListingProductVariantFragment = gql` fragment ChannelListingProductVariant on ProductVariantChannelListing { + id channel { id name diff --git a/src/graphql/fragmentTypes.generated.ts b/src/graphql/fragmentTypes.generated.ts index 8e207f1a4..bac4d47b9 100644 --- a/src/graphql/fragmentTypes.generated.ts +++ b/src/graphql/fragmentTypes.generated.ts @@ -98,6 +98,7 @@ "ProductVariantDeleted", "ProductVariantMetadataUpdated", "ProductVariantOutOfStock", + "ProductVariantStockUpdated", "ProductVariantUpdated", "SaleCreated", "SaleDeleted", @@ -224,6 +225,7 @@ "Webhook" ], "ObjectWithMetadata": [ + "Address", "App", "Attribute", "Category", diff --git a/src/graphql/hooks.generated.ts b/src/graphql/hooks.generated.ts index 7c2bf8b75..e85bb44dc 100644 --- a/src/graphql/hooks.generated.ts +++ b/src/graphql/hooks.generated.ts @@ -682,6 +682,17 @@ export const BulkProductErrorFragmentDoc = gql` message } `; +export const ProductVariantBulkErrorFragmentDoc = gql` + fragment ProductVariantBulkError on ProductVariantBulkError { + field + code + message + attributes + values + warehouses + channels +} + `; export const BulkStockErrorFragmentDoc = gql` fragment BulkStockError on BulkStockError { code @@ -2031,6 +2042,7 @@ export const PreorderFragmentDoc = gql` `; export const ChannelListingProductVariantFragmentDoc = gql` fragment ChannelListingProductVariant on ProductVariantChannelListing { + id channel { id name @@ -11765,121 +11777,6 @@ export function useVariantDeleteMutation(baseOptions?: ApolloReactHooks.Mutation export type VariantDeleteMutationHookResult = ReturnType; export type VariantDeleteMutationResult = Apollo.MutationResult; export type VariantDeleteMutationOptions = Apollo.BaseMutationOptions; -export const VariantDatagridUpdateDocument = gql` - mutation VariantDatagridUpdate($id: ID!, $input: ProductVariantInput!) { - productVariantUpdate(id: $id, input: $input) { - errors { - ...ProductErrorWithAttributes - } - } -} - ${ProductErrorWithAttributesFragmentDoc}`; -export type VariantDatagridUpdateMutationFn = Apollo.MutationFunction; - -/** - * __useVariantDatagridUpdateMutation__ - * - * To run a mutation, you first call `useVariantDatagridUpdateMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useVariantDatagridUpdateMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [variantDatagridUpdateMutation, { data, loading, error }] = useVariantDatagridUpdateMutation({ - * variables: { - * id: // value for 'id' - * input: // value for 'input' - * }, - * }); - */ -export function useVariantDatagridUpdateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(VariantDatagridUpdateDocument, options); - } -export type VariantDatagridUpdateMutationHookResult = ReturnType; -export type VariantDatagridUpdateMutationResult = Apollo.MutationResult; -export type VariantDatagridUpdateMutationOptions = Apollo.BaseMutationOptions; -export const VariantDatagridStockUpdateDocument = gql` - mutation VariantDatagridStockUpdate($stocks: [StockInput!]!, $removeStocks: [ID!]!, $id: ID!) { - productVariantStocksDelete(warehouseIds: $removeStocks, variantId: $id) { - errors { - ...ProductVariantStocksDeleteError - } - } - productVariantStocksUpdate(stocks: $stocks, variantId: $id) { - errors { - ...BulkStockError - } - } -} - ${ProductVariantStocksDeleteErrorFragmentDoc} -${BulkStockErrorFragmentDoc}`; -export type VariantDatagridStockUpdateMutationFn = Apollo.MutationFunction; - -/** - * __useVariantDatagridStockUpdateMutation__ - * - * To run a mutation, you first call `useVariantDatagridStockUpdateMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useVariantDatagridStockUpdateMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [variantDatagridStockUpdateMutation, { data, loading, error }] = useVariantDatagridStockUpdateMutation({ - * variables: { - * stocks: // value for 'stocks' - * removeStocks: // value for 'removeStocks' - * id: // value for 'id' - * }, - * }); - */ -export function useVariantDatagridStockUpdateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(VariantDatagridStockUpdateDocument, options); - } -export type VariantDatagridStockUpdateMutationHookResult = ReturnType; -export type VariantDatagridStockUpdateMutationResult = Apollo.MutationResult; -export type VariantDatagridStockUpdateMutationOptions = Apollo.BaseMutationOptions; -export const VariantDatagridChannelListingUpdateDocument = gql` - mutation VariantDatagridChannelListingUpdate($id: ID!, $input: [ProductVariantChannelListingAddInput!]!) { - productVariantChannelListingUpdate(id: $id, input: $input) { - errors { - ...ProductChannelListingError - } - } -} - ${ProductChannelListingErrorFragmentDoc}`; -export type VariantDatagridChannelListingUpdateMutationFn = Apollo.MutationFunction; - -/** - * __useVariantDatagridChannelListingUpdateMutation__ - * - * To run a mutation, you first call `useVariantDatagridChannelListingUpdateMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useVariantDatagridChannelListingUpdateMutation` returns a tuple that includes: - * - A mutate function that you can call at any time to execute the mutation - * - An object with fields that represent the current status of the mutation's execution - * - * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; - * - * @example - * const [variantDatagridChannelListingUpdateMutation, { data, loading, error }] = useVariantDatagridChannelListingUpdateMutation({ - * variables: { - * id: // value for 'id' - * input: // value for 'input' - * }, - * }); - */ -export function useVariantDatagridChannelListingUpdateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(VariantDatagridChannelListingUpdateDocument, options); - } -export type VariantDatagridChannelListingUpdateMutationHookResult = ReturnType; -export type VariantDatagridChannelListingUpdateMutationResult = Apollo.MutationResult; -export type VariantDatagridChannelListingUpdateMutationOptions = Apollo.BaseMutationOptions; export const VariantUpdateDocument = gql` mutation VariantUpdate($addStocks: [StockInput!]!, $removeStocks: [ID!]!, $id: ID!, $attributes: [AttributeValueInput!], $sku: String, $quantityLimitPerCustomer: Int, $trackInventory: Boolean!, $stocks: [StockInput!]!, $preorder: PreorderSettingsInput, $weight: WeightScalar, $firstValues: Int, $afterValues: String, $lastValues: Int, $beforeValues: String, $name: String!) { productVariantStocksDelete(warehouseIds: $removeStocks, variantId: $id) { @@ -12528,6 +12425,52 @@ export function useProductVariantPreorderDeactivateMutation(baseOptions?: Apollo export type ProductVariantPreorderDeactivateMutationHookResult = ReturnType; export type ProductVariantPreorderDeactivateMutationResult = Apollo.MutationResult; export type ProductVariantPreorderDeactivateMutationOptions = Apollo.BaseMutationOptions; +export const ProductVariantBulkUpdateDocument = gql` + mutation ProductVariantBulkUpdate($product: ID!, $input: [ProductVariantBulkUpdateInput!]!, $errorPolicy: ErrorPolicyEnum) { + productVariantBulkUpdate( + errorPolicy: $errorPolicy + product: $product + variants: $input + ) { + errors { + ...ProductVariantBulkError + } + results { + errors { + ...ProductVariantBulkError + } + } + } +} + ${ProductVariantBulkErrorFragmentDoc}`; +export type ProductVariantBulkUpdateMutationFn = Apollo.MutationFunction; + +/** + * __useProductVariantBulkUpdateMutation__ + * + * To run a mutation, you first call `useProductVariantBulkUpdateMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useProductVariantBulkUpdateMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [productVariantBulkUpdateMutation, { data, loading, error }] = useProductVariantBulkUpdateMutation({ + * variables: { + * product: // value for 'product' + * input: // value for 'input' + * errorPolicy: // value for 'errorPolicy' + * }, + * }); + */ +export function useProductVariantBulkUpdateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(ProductVariantBulkUpdateDocument, options); + } +export type ProductVariantBulkUpdateMutationHookResult = ReturnType; +export type ProductVariantBulkUpdateMutationResult = Apollo.MutationResult; +export type ProductVariantBulkUpdateMutationOptions = Apollo.BaseMutationOptions; export const InitialProductFilterAttributesDocument = gql` query InitialProductFilterAttributes { attributes(first: 100, filter: {type: PRODUCT_TYPE}) { diff --git a/src/graphql/typePolicies.generated.ts b/src/graphql/typePolicies.generated.ts index ad6f5e23d..90b3a1c77 100644 --- a/src/graphql/typePolicies.generated.ts +++ b/src/graphql/typePolicies.generated.ts @@ -58,9 +58,15 @@ export type AccountUpdateFieldPolicy = { errors?: FieldPolicy | FieldReadFunction, user?: FieldPolicy | FieldReadFunction }; -export type AddressKeySpecifier = ('id' | 'firstName' | 'lastName' | 'companyName' | 'streetAddress1' | 'streetAddress2' | 'city' | 'cityArea' | 'postalCode' | 'country' | 'countryArea' | 'phone' | 'isDefaultShippingAddress' | 'isDefaultBillingAddress' | AddressKeySpecifier)[]; +export type AddressKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'firstName' | 'lastName' | 'companyName' | 'streetAddress1' | 'streetAddress2' | 'city' | 'cityArea' | 'postalCode' | 'country' | 'countryArea' | 'phone' | 'isDefaultShippingAddress' | 'isDefaultBillingAddress' | AddressKeySpecifier)[]; export type AddressFieldPolicy = { id?: FieldPolicy | FieldReadFunction, + privateMetadata?: FieldPolicy | FieldReadFunction, + privateMetafield?: FieldPolicy | FieldReadFunction, + privateMetafields?: FieldPolicy | FieldReadFunction, + metadata?: FieldPolicy | FieldReadFunction, + metafield?: FieldPolicy | FieldReadFunction, + metafields?: FieldPolicy | FieldReadFunction, firstName?: FieldPolicy | FieldReadFunction, lastName?: FieldPolicy | FieldReadFunction, companyName?: FieldPolicy | FieldReadFunction, @@ -1967,7 +1973,7 @@ export type ImageFieldPolicy = { url?: FieldPolicy | FieldReadFunction, alt?: FieldPolicy | FieldReadFunction }; -export type InvoiceKeySpecifier = ('privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'status' | 'createdAt' | 'updatedAt' | 'message' | 'id' | 'number' | 'externalUrl' | 'url' | InvoiceKeySpecifier)[]; +export type InvoiceKeySpecifier = ('privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'status' | 'createdAt' | 'updatedAt' | 'message' | 'id' | 'number' | 'externalUrl' | 'url' | 'order' | InvoiceKeySpecifier)[]; export type InvoiceFieldPolicy = { privateMetadata?: FieldPolicy | FieldReadFunction, privateMetafield?: FieldPolicy | FieldReadFunction, @@ -1982,7 +1988,8 @@ export type InvoiceFieldPolicy = { id?: FieldPolicy | FieldReadFunction, number?: FieldPolicy | FieldReadFunction, externalUrl?: FieldPolicy | FieldReadFunction, - url?: FieldPolicy | FieldReadFunction + url?: FieldPolicy | FieldReadFunction, + order?: FieldPolicy | FieldReadFunction }; export type InvoiceCreateKeySpecifier = ('invoiceErrors' | 'errors' | 'invoice' | InvoiceCreateKeySpecifier)[]; export type InvoiceCreateFieldPolicy = { @@ -1996,13 +2003,14 @@ export type InvoiceDeleteFieldPolicy = { errors?: FieldPolicy | FieldReadFunction, invoice?: FieldPolicy | FieldReadFunction }; -export type InvoiceDeletedKeySpecifier = ('issuedAt' | 'version' | 'issuingPrincipal' | 'recipient' | 'invoice' | InvoiceDeletedKeySpecifier)[]; +export type InvoiceDeletedKeySpecifier = ('issuedAt' | 'version' | 'issuingPrincipal' | 'recipient' | 'invoice' | 'order' | InvoiceDeletedKeySpecifier)[]; export type InvoiceDeletedFieldPolicy = { issuedAt?: FieldPolicy | FieldReadFunction, version?: FieldPolicy | FieldReadFunction, issuingPrincipal?: FieldPolicy | FieldReadFunction, recipient?: FieldPolicy | FieldReadFunction, - invoice?: FieldPolicy | FieldReadFunction + invoice?: FieldPolicy | FieldReadFunction, + order?: FieldPolicy | FieldReadFunction }; export type InvoiceErrorKeySpecifier = ('field' | 'message' | 'code' | InvoiceErrorKeySpecifier)[]; export type InvoiceErrorFieldPolicy = { @@ -2023,13 +2031,14 @@ export type InvoiceRequestDeleteFieldPolicy = { errors?: FieldPolicy | FieldReadFunction, invoice?: FieldPolicy | FieldReadFunction }; -export type InvoiceRequestedKeySpecifier = ('issuedAt' | 'version' | 'issuingPrincipal' | 'recipient' | 'invoice' | InvoiceRequestedKeySpecifier)[]; +export type InvoiceRequestedKeySpecifier = ('issuedAt' | 'version' | 'issuingPrincipal' | 'recipient' | 'invoice' | 'order' | InvoiceRequestedKeySpecifier)[]; export type InvoiceRequestedFieldPolicy = { issuedAt?: FieldPolicy | FieldReadFunction, version?: FieldPolicy | FieldReadFunction, issuingPrincipal?: FieldPolicy | FieldReadFunction, recipient?: FieldPolicy | FieldReadFunction, - invoice?: FieldPolicy | FieldReadFunction + invoice?: FieldPolicy | FieldReadFunction, + order?: FieldPolicy | FieldReadFunction }; export type InvoiceSendNotificationKeySpecifier = ('invoiceErrors' | 'errors' | 'invoice' | InvoiceSendNotificationKeySpecifier)[]; export type InvoiceSendNotificationFieldPolicy = { @@ -2037,13 +2046,14 @@ export type InvoiceSendNotificationFieldPolicy = { errors?: FieldPolicy | FieldReadFunction, invoice?: FieldPolicy | FieldReadFunction }; -export type InvoiceSentKeySpecifier = ('issuedAt' | 'version' | 'issuingPrincipal' | 'recipient' | 'invoice' | InvoiceSentKeySpecifier)[]; +export type InvoiceSentKeySpecifier = ('issuedAt' | 'version' | 'issuingPrincipal' | 'recipient' | 'invoice' | 'order' | InvoiceSentKeySpecifier)[]; export type InvoiceSentFieldPolicy = { issuedAt?: FieldPolicy | FieldReadFunction, version?: FieldPolicy | FieldReadFunction, issuingPrincipal?: FieldPolicy | FieldReadFunction, recipient?: FieldPolicy | FieldReadFunction, - invoice?: FieldPolicy | FieldReadFunction + invoice?: FieldPolicy | FieldReadFunction, + order?: FieldPolicy | FieldReadFunction }; export type InvoiceUpdateKeySpecifier = ('invoiceErrors' | 'errors' | 'invoice' | InvoiceUpdateKeySpecifier)[]; export type InvoiceUpdateFieldPolicy = { @@ -2302,7 +2312,7 @@ export type MoneyRangeFieldPolicy = { start?: FieldPolicy | FieldReadFunction, stop?: FieldPolicy | FieldReadFunction }; -export type MutationKeySpecifier = ('webhookCreate' | 'webhookDelete' | 'webhookUpdate' | 'eventDeliveryRetry' | 'webhookDryRun' | 'webhookTrigger' | 'createWarehouse' | 'updateWarehouse' | 'deleteWarehouse' | 'assignWarehouseShippingZone' | 'unassignWarehouseShippingZone' | 'taxClassCreate' | 'taxClassDelete' | 'taxClassUpdate' | 'taxConfigurationUpdate' | 'taxCountryConfigurationUpdate' | 'taxCountryConfigurationDelete' | 'taxExemptionManage' | 'staffNotificationRecipientCreate' | 'staffNotificationRecipientUpdate' | 'staffNotificationRecipientDelete' | 'shopDomainUpdate' | 'shopSettingsUpdate' | 'shopFetchTaxRates' | 'shopSettingsTranslate' | 'shopAddressUpdate' | 'orderSettingsUpdate' | 'giftCardSettingsUpdate' | 'shippingMethodChannelListingUpdate' | 'shippingPriceCreate' | 'shippingPriceDelete' | 'shippingPriceBulkDelete' | 'shippingPriceUpdate' | 'shippingPriceTranslate' | 'shippingPriceExcludeProducts' | 'shippingPriceRemoveProductFromExclude' | 'shippingZoneCreate' | 'shippingZoneDelete' | 'shippingZoneBulkDelete' | 'shippingZoneUpdate' | 'productAttributeAssign' | 'productAttributeAssignmentUpdate' | 'productAttributeUnassign' | 'categoryCreate' | 'categoryDelete' | 'categoryBulkDelete' | 'categoryUpdate' | 'categoryTranslate' | 'collectionAddProducts' | 'collectionCreate' | 'collectionDelete' | 'collectionReorderProducts' | 'collectionBulkDelete' | 'collectionRemoveProducts' | 'collectionUpdate' | 'collectionTranslate' | 'collectionChannelListingUpdate' | 'productCreate' | 'productDelete' | 'productBulkDelete' | 'productUpdate' | 'productTranslate' | 'productChannelListingUpdate' | 'productMediaCreate' | 'productVariantReorder' | 'productMediaDelete' | 'productMediaBulkDelete' | 'productMediaReorder' | 'productMediaUpdate' | 'productTypeCreate' | 'productTypeDelete' | 'productTypeBulkDelete' | 'productTypeUpdate' | 'productTypeReorderAttributes' | 'productReorderAttributeValues' | 'digitalContentCreate' | 'digitalContentDelete' | 'digitalContentUpdate' | 'digitalContentUrlCreate' | 'productVariantCreate' | 'productVariantDelete' | 'productVariantBulkCreate' | 'productVariantBulkDelete' | 'productVariantStocksCreate' | 'productVariantStocksDelete' | 'productVariantStocksUpdate' | 'productVariantUpdate' | 'productVariantSetDefault' | 'productVariantTranslate' | 'productVariantChannelListingUpdate' | 'productVariantReorderAttributeValues' | 'productVariantPreorderDeactivate' | 'variantMediaAssign' | 'variantMediaUnassign' | 'paymentCapture' | 'paymentRefund' | 'paymentVoid' | 'paymentInitialize' | 'paymentCheckBalance' | 'transactionCreate' | 'transactionUpdate' | 'transactionRequestAction' | 'pageCreate' | 'pageDelete' | 'pageBulkDelete' | 'pageBulkPublish' | 'pageUpdate' | 'pageTranslate' | 'pageTypeCreate' | 'pageTypeUpdate' | 'pageTypeDelete' | 'pageTypeBulkDelete' | 'pageAttributeAssign' | 'pageAttributeUnassign' | 'pageTypeReorderAttributes' | 'pageReorderAttributeValues' | 'draftOrderComplete' | 'draftOrderCreate' | 'draftOrderDelete' | 'draftOrderBulkDelete' | 'draftOrderLinesBulkDelete' | 'draftOrderUpdate' | 'orderAddNote' | 'orderCancel' | 'orderCapture' | 'orderConfirm' | 'orderFulfill' | 'orderFulfillmentCancel' | 'orderFulfillmentApprove' | 'orderFulfillmentUpdateTracking' | 'orderFulfillmentRefundProducts' | 'orderFulfillmentReturnProducts' | 'orderLinesCreate' | 'orderLineDelete' | 'orderLineUpdate' | 'orderDiscountAdd' | 'orderDiscountUpdate' | 'orderDiscountDelete' | 'orderLineDiscountUpdate' | 'orderLineDiscountRemove' | 'orderMarkAsPaid' | 'orderRefund' | 'orderUpdate' | 'orderUpdateShipping' | 'orderVoid' | 'orderBulkCancel' | 'deleteMetadata' | 'deletePrivateMetadata' | 'updateMetadata' | 'updatePrivateMetadata' | 'assignNavigation' | 'menuCreate' | 'menuDelete' | 'menuBulkDelete' | 'menuUpdate' | 'menuItemCreate' | 'menuItemDelete' | 'menuItemBulkDelete' | 'menuItemUpdate' | 'menuItemTranslate' | 'menuItemMove' | 'invoiceRequest' | 'invoiceRequestDelete' | 'invoiceCreate' | 'invoiceDelete' | 'invoiceUpdate' | 'invoiceSendNotification' | 'giftCardActivate' | 'giftCardCreate' | 'giftCardDelete' | 'giftCardDeactivate' | 'giftCardUpdate' | 'giftCardResend' | 'giftCardAddNote' | 'giftCardBulkCreate' | 'giftCardBulkDelete' | 'giftCardBulkActivate' | 'giftCardBulkDeactivate' | 'pluginUpdate' | 'externalNotificationTrigger' | 'saleCreate' | 'saleDelete' | 'saleBulkDelete' | 'saleUpdate' | 'saleCataloguesAdd' | 'saleCataloguesRemove' | 'saleTranslate' | 'saleChannelListingUpdate' | 'voucherCreate' | 'voucherDelete' | 'voucherBulkDelete' | 'voucherUpdate' | 'voucherCataloguesAdd' | 'voucherCataloguesRemove' | 'voucherTranslate' | 'voucherChannelListingUpdate' | 'exportProducts' | 'exportGiftCards' | 'fileUpload' | 'checkoutAddPromoCode' | 'checkoutBillingAddressUpdate' | 'checkoutComplete' | 'checkoutCreate' | 'checkoutCustomerAttach' | 'checkoutCustomerDetach' | 'checkoutEmailUpdate' | 'checkoutLineDelete' | 'checkoutLinesDelete' | 'checkoutLinesAdd' | 'checkoutLinesUpdate' | 'checkoutRemovePromoCode' | 'checkoutPaymentCreate' | 'checkoutShippingAddressUpdate' | 'checkoutShippingMethodUpdate' | 'checkoutDeliveryMethodUpdate' | 'checkoutLanguageCodeUpdate' | 'orderCreateFromCheckout' | 'channelCreate' | 'channelUpdate' | 'channelDelete' | 'channelActivate' | 'channelDeactivate' | 'channelReorderWarehouses' | 'attributeCreate' | 'attributeDelete' | 'attributeUpdate' | 'attributeTranslate' | 'attributeBulkDelete' | 'attributeValueBulkDelete' | 'attributeValueCreate' | 'attributeValueDelete' | 'attributeValueUpdate' | 'attributeValueTranslate' | 'attributeReorderValues' | 'appCreate' | 'appUpdate' | 'appDelete' | 'appTokenCreate' | 'appTokenDelete' | 'appTokenVerify' | 'appInstall' | 'appRetryInstall' | 'appDeleteFailedInstallation' | 'appFetchManifest' | 'appActivate' | 'appDeactivate' | 'tokenCreate' | 'tokenRefresh' | 'tokenVerify' | 'tokensDeactivateAll' | 'externalAuthenticationUrl' | 'externalObtainAccessTokens' | 'externalRefresh' | 'externalLogout' | 'externalVerify' | 'requestPasswordReset' | 'confirmAccount' | 'setPassword' | 'passwordChange' | 'requestEmailChange' | 'confirmEmailChange' | 'accountAddressCreate' | 'accountAddressUpdate' | 'accountAddressDelete' | 'accountSetDefaultAddress' | 'accountRegister' | 'accountUpdate' | 'accountRequestDeletion' | 'accountDelete' | 'addressCreate' | 'addressUpdate' | 'addressDelete' | 'addressSetDefault' | 'customerCreate' | 'customerUpdate' | 'customerDelete' | 'customerBulkDelete' | 'staffCreate' | 'staffUpdate' | 'staffDelete' | 'staffBulkDelete' | 'userAvatarUpdate' | 'userAvatarDelete' | 'userBulkSetActive' | 'permissionGroupCreate' | 'permissionGroupUpdate' | 'permissionGroupDelete' | MutationKeySpecifier)[]; +export type MutationKeySpecifier = ('webhookCreate' | 'webhookDelete' | 'webhookUpdate' | 'eventDeliveryRetry' | 'webhookDryRun' | 'webhookTrigger' | 'createWarehouse' | 'updateWarehouse' | 'deleteWarehouse' | 'assignWarehouseShippingZone' | 'unassignWarehouseShippingZone' | 'taxClassCreate' | 'taxClassDelete' | 'taxClassUpdate' | 'taxConfigurationUpdate' | 'taxCountryConfigurationUpdate' | 'taxCountryConfigurationDelete' | 'taxExemptionManage' | 'staffNotificationRecipientCreate' | 'staffNotificationRecipientUpdate' | 'staffNotificationRecipientDelete' | 'shopDomainUpdate' | 'shopSettingsUpdate' | 'shopFetchTaxRates' | 'shopSettingsTranslate' | 'shopAddressUpdate' | 'orderSettingsUpdate' | 'giftCardSettingsUpdate' | 'shippingMethodChannelListingUpdate' | 'shippingPriceCreate' | 'shippingPriceDelete' | 'shippingPriceBulkDelete' | 'shippingPriceUpdate' | 'shippingPriceTranslate' | 'shippingPriceExcludeProducts' | 'shippingPriceRemoveProductFromExclude' | 'shippingZoneCreate' | 'shippingZoneDelete' | 'shippingZoneBulkDelete' | 'shippingZoneUpdate' | 'productAttributeAssign' | 'productAttributeAssignmentUpdate' | 'productAttributeUnassign' | 'categoryCreate' | 'categoryDelete' | 'categoryBulkDelete' | 'categoryUpdate' | 'categoryTranslate' | 'collectionAddProducts' | 'collectionCreate' | 'collectionDelete' | 'collectionReorderProducts' | 'collectionBulkDelete' | 'collectionRemoveProducts' | 'collectionUpdate' | 'collectionTranslate' | 'collectionChannelListingUpdate' | 'productCreate' | 'productDelete' | 'productBulkDelete' | 'productUpdate' | 'productTranslate' | 'productChannelListingUpdate' | 'productMediaCreate' | 'productVariantReorder' | 'productMediaDelete' | 'productMediaBulkDelete' | 'productMediaReorder' | 'productMediaUpdate' | 'productTypeCreate' | 'productTypeDelete' | 'productTypeBulkDelete' | 'productTypeUpdate' | 'productTypeReorderAttributes' | 'productReorderAttributeValues' | 'digitalContentCreate' | 'digitalContentDelete' | 'digitalContentUpdate' | 'digitalContentUrlCreate' | 'productVariantCreate' | 'productVariantDelete' | 'productVariantBulkCreate' | 'productVariantBulkUpdate' | 'productVariantBulkDelete' | 'productVariantStocksCreate' | 'productVariantStocksDelete' | 'productVariantStocksUpdate' | 'productVariantUpdate' | 'productVariantSetDefault' | 'productVariantTranslate' | 'productVariantChannelListingUpdate' | 'productVariantReorderAttributeValues' | 'productVariantPreorderDeactivate' | 'variantMediaAssign' | 'variantMediaUnassign' | 'paymentCapture' | 'paymentRefund' | 'paymentVoid' | 'paymentInitialize' | 'paymentCheckBalance' | 'transactionCreate' | 'transactionUpdate' | 'transactionRequestAction' | 'pageCreate' | 'pageDelete' | 'pageBulkDelete' | 'pageBulkPublish' | 'pageUpdate' | 'pageTranslate' | 'pageTypeCreate' | 'pageTypeUpdate' | 'pageTypeDelete' | 'pageTypeBulkDelete' | 'pageAttributeAssign' | 'pageAttributeUnassign' | 'pageTypeReorderAttributes' | 'pageReorderAttributeValues' | 'draftOrderComplete' | 'draftOrderCreate' | 'draftOrderDelete' | 'draftOrderBulkDelete' | 'draftOrderLinesBulkDelete' | 'draftOrderUpdate' | 'orderAddNote' | 'orderCancel' | 'orderCapture' | 'orderConfirm' | 'orderFulfill' | 'orderFulfillmentCancel' | 'orderFulfillmentApprove' | 'orderFulfillmentUpdateTracking' | 'orderFulfillmentRefundProducts' | 'orderFulfillmentReturnProducts' | 'orderLinesCreate' | 'orderLineDelete' | 'orderLineUpdate' | 'orderDiscountAdd' | 'orderDiscountUpdate' | 'orderDiscountDelete' | 'orderLineDiscountUpdate' | 'orderLineDiscountRemove' | 'orderMarkAsPaid' | 'orderRefund' | 'orderUpdate' | 'orderUpdateShipping' | 'orderVoid' | 'orderBulkCancel' | 'deleteMetadata' | 'deletePrivateMetadata' | 'updateMetadata' | 'updatePrivateMetadata' | 'assignNavigation' | 'menuCreate' | 'menuDelete' | 'menuBulkDelete' | 'menuUpdate' | 'menuItemCreate' | 'menuItemDelete' | 'menuItemBulkDelete' | 'menuItemUpdate' | 'menuItemTranslate' | 'menuItemMove' | 'invoiceRequest' | 'invoiceRequestDelete' | 'invoiceCreate' | 'invoiceDelete' | 'invoiceUpdate' | 'invoiceSendNotification' | 'giftCardActivate' | 'giftCardCreate' | 'giftCardDelete' | 'giftCardDeactivate' | 'giftCardUpdate' | 'giftCardResend' | 'giftCardAddNote' | 'giftCardBulkCreate' | 'giftCardBulkDelete' | 'giftCardBulkActivate' | 'giftCardBulkDeactivate' | 'pluginUpdate' | 'externalNotificationTrigger' | 'saleCreate' | 'saleDelete' | 'saleBulkDelete' | 'saleUpdate' | 'saleCataloguesAdd' | 'saleCataloguesRemove' | 'saleTranslate' | 'saleChannelListingUpdate' | 'voucherCreate' | 'voucherDelete' | 'voucherBulkDelete' | 'voucherUpdate' | 'voucherCataloguesAdd' | 'voucherCataloguesRemove' | 'voucherTranslate' | 'voucherChannelListingUpdate' | 'exportProducts' | 'exportGiftCards' | 'fileUpload' | 'checkoutAddPromoCode' | 'checkoutBillingAddressUpdate' | 'checkoutComplete' | 'checkoutCreate' | 'checkoutCustomerAttach' | 'checkoutCustomerDetach' | 'checkoutEmailUpdate' | 'checkoutLineDelete' | 'checkoutLinesDelete' | 'checkoutLinesAdd' | 'checkoutLinesUpdate' | 'checkoutRemovePromoCode' | 'checkoutPaymentCreate' | 'checkoutShippingAddressUpdate' | 'checkoutShippingMethodUpdate' | 'checkoutDeliveryMethodUpdate' | 'checkoutLanguageCodeUpdate' | 'orderCreateFromCheckout' | 'channelCreate' | 'channelUpdate' | 'channelDelete' | 'channelActivate' | 'channelDeactivate' | 'channelReorderWarehouses' | 'attributeCreate' | 'attributeDelete' | 'attributeUpdate' | 'attributeTranslate' | 'attributeBulkDelete' | 'attributeValueBulkDelete' | 'attributeValueCreate' | 'attributeValueDelete' | 'attributeValueUpdate' | 'attributeValueTranslate' | 'attributeReorderValues' | 'appCreate' | 'appUpdate' | 'appDelete' | 'appTokenCreate' | 'appTokenDelete' | 'appTokenVerify' | 'appInstall' | 'appRetryInstall' | 'appDeleteFailedInstallation' | 'appFetchManifest' | 'appActivate' | 'appDeactivate' | 'tokenCreate' | 'tokenRefresh' | 'tokenVerify' | 'tokensDeactivateAll' | 'externalAuthenticationUrl' | 'externalObtainAccessTokens' | 'externalRefresh' | 'externalLogout' | 'externalVerify' | 'requestPasswordReset' | 'confirmAccount' | 'setPassword' | 'passwordChange' | 'requestEmailChange' | 'confirmEmailChange' | 'accountAddressCreate' | 'accountAddressUpdate' | 'accountAddressDelete' | 'accountSetDefaultAddress' | 'accountRegister' | 'accountUpdate' | 'accountRequestDeletion' | 'accountDelete' | 'addressCreate' | 'addressUpdate' | 'addressDelete' | 'addressSetDefault' | 'customerCreate' | 'customerUpdate' | 'customerDelete' | 'customerBulkDelete' | 'staffCreate' | 'staffUpdate' | 'staffDelete' | 'staffBulkDelete' | 'userAvatarUpdate' | 'userAvatarDelete' | 'userBulkSetActive' | 'permissionGroupCreate' | 'permissionGroupUpdate' | 'permissionGroupDelete' | MutationKeySpecifier)[]; export type MutationFieldPolicy = { webhookCreate?: FieldPolicy | FieldReadFunction, webhookDelete?: FieldPolicy | FieldReadFunction, @@ -2386,6 +2396,7 @@ export type MutationFieldPolicy = { productVariantCreate?: FieldPolicy | FieldReadFunction, productVariantDelete?: FieldPolicy | FieldReadFunction, productVariantBulkCreate?: FieldPolicy | FieldReadFunction, + productVariantBulkUpdate?: FieldPolicy | FieldReadFunction, productVariantBulkDelete?: FieldPolicy | FieldReadFunction, productVariantStocksCreate?: FieldPolicy | FieldReadFunction, productVariantStocksDelete?: FieldPolicy | FieldReadFunction, @@ -2605,7 +2616,7 @@ export type ObjectWithMetadataFieldPolicy = { metafield?: FieldPolicy | FieldReadFunction, metafields?: FieldPolicy | FieldReadFunction }; -export type OrderKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'created' | 'updatedAt' | 'status' | 'user' | 'trackingClientId' | 'billingAddress' | 'shippingAddress' | 'shippingMethodName' | 'collectionPointName' | 'channel' | 'fulfillments' | 'lines' | 'actions' | 'availableShippingMethods' | 'shippingMethods' | 'availableCollectionPoints' | 'invoices' | 'number' | 'original' | 'origin' | 'isPaid' | 'paymentStatus' | 'paymentStatusDisplay' | 'authorizeStatus' | 'chargeStatus' | 'taxExemption' | 'transactions' | 'payments' | 'total' | 'undiscountedTotal' | 'shippingMethod' | 'shippingPrice' | 'shippingTaxRate' | 'shippingTaxClass' | 'shippingTaxClassName' | 'shippingTaxClassMetadata' | 'shippingTaxClassPrivateMetadata' | 'token' | 'voucher' | 'giftCards' | 'customerNote' | 'weight' | 'redirectUrl' | 'subtotal' | 'statusDisplay' | 'canFinalize' | 'totalAuthorized' | 'totalCaptured' | 'events' | 'totalBalance' | 'userEmail' | 'isShippingRequired' | 'deliveryMethod' | 'languageCode' | 'languageCodeEnum' | 'discount' | 'discountName' | 'translatedDiscountName' | 'discounts' | 'errors' | 'displayGrossPrices' | 'externalReference' | OrderKeySpecifier)[]; +export type OrderKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'created' | 'updatedAt' | 'status' | 'user' | 'trackingClientId' | 'billingAddress' | 'shippingAddress' | 'shippingMethodName' | 'collectionPointName' | 'channel' | 'fulfillments' | 'lines' | 'actions' | 'availableShippingMethods' | 'shippingMethods' | 'availableCollectionPoints' | 'invoices' | 'number' | 'original' | 'origin' | 'isPaid' | 'paymentStatus' | 'paymentStatusDisplay' | 'authorizeStatus' | 'chargeStatus' | 'taxExemption' | 'transactions' | 'payments' | 'total' | 'undiscountedTotal' | 'shippingMethod' | 'shippingPrice' | 'shippingTaxRate' | 'shippingTaxClass' | 'shippingTaxClassName' | 'shippingTaxClassMetadata' | 'shippingTaxClassPrivateMetadata' | 'token' | 'voucher' | 'giftCards' | 'customerNote' | 'weight' | 'redirectUrl' | 'subtotal' | 'statusDisplay' | 'canFinalize' | 'totalAuthorized' | 'totalCaptured' | 'events' | 'totalBalance' | 'userEmail' | 'isShippingRequired' | 'deliveryMethod' | 'languageCode' | 'languageCodeEnum' | 'discount' | 'discountName' | 'translatedDiscountName' | 'discounts' | 'errors' | 'displayGrossPrices' | 'externalReference' | 'checkoutId' | OrderKeySpecifier)[]; export type OrderFieldPolicy = { id?: FieldPolicy | FieldReadFunction, privateMetadata?: FieldPolicy | FieldReadFunction, @@ -2675,7 +2686,8 @@ export type OrderFieldPolicy = { discounts?: FieldPolicy | FieldReadFunction, errors?: FieldPolicy | FieldReadFunction, displayGrossPrices?: FieldPolicy | FieldReadFunction, - externalReference?: FieldPolicy | FieldReadFunction + externalReference?: FieldPolicy | FieldReadFunction, + checkoutId?: FieldPolicy | FieldReadFunction }; export type OrderAddNoteKeySpecifier = ('order' | 'event' | 'orderErrors' | 'errors' | OrderAddNoteKeySpecifier)[]; export type OrderAddNoteFieldPolicy = { @@ -3881,10 +3893,11 @@ export type ProductVariantBackInStockFieldPolicy = { productVariant?: FieldPolicy | FieldReadFunction, warehouse?: FieldPolicy | FieldReadFunction }; -export type ProductVariantBulkCreateKeySpecifier = ('count' | 'productVariants' | 'bulkProductErrors' | 'errors' | ProductVariantBulkCreateKeySpecifier)[]; +export type ProductVariantBulkCreateKeySpecifier = ('count' | 'productVariants' | 'results' | 'bulkProductErrors' | 'errors' | ProductVariantBulkCreateKeySpecifier)[]; export type ProductVariantBulkCreateFieldPolicy = { count?: FieldPolicy | FieldReadFunction, productVariants?: FieldPolicy | FieldReadFunction, + results?: FieldPolicy | FieldReadFunction, bulkProductErrors?: FieldPolicy | FieldReadFunction, errors?: FieldPolicy | FieldReadFunction }; @@ -3894,6 +3907,29 @@ export type ProductVariantBulkDeleteFieldPolicy = { productErrors?: FieldPolicy | FieldReadFunction, errors?: FieldPolicy | FieldReadFunction }; +export type ProductVariantBulkErrorKeySpecifier = ('field' | 'message' | 'code' | 'attributes' | 'values' | 'warehouses' | 'stocks' | 'channels' | 'channelListings' | ProductVariantBulkErrorKeySpecifier)[]; +export type ProductVariantBulkErrorFieldPolicy = { + field?: FieldPolicy | FieldReadFunction, + message?: FieldPolicy | FieldReadFunction, + code?: FieldPolicy | FieldReadFunction, + attributes?: FieldPolicy | FieldReadFunction, + values?: FieldPolicy | FieldReadFunction, + warehouses?: FieldPolicy | FieldReadFunction, + stocks?: FieldPolicy | FieldReadFunction, + channels?: FieldPolicy | FieldReadFunction, + channelListings?: FieldPolicy | FieldReadFunction +}; +export type ProductVariantBulkResultKeySpecifier = ('productVariant' | 'errors' | ProductVariantBulkResultKeySpecifier)[]; +export type ProductVariantBulkResultFieldPolicy = { + productVariant?: FieldPolicy | FieldReadFunction, + errors?: FieldPolicy | FieldReadFunction +}; +export type ProductVariantBulkUpdateKeySpecifier = ('count' | 'results' | 'errors' | ProductVariantBulkUpdateKeySpecifier)[]; +export type ProductVariantBulkUpdateFieldPolicy = { + count?: FieldPolicy | FieldReadFunction, + results?: FieldPolicy | FieldReadFunction, + errors?: FieldPolicy | FieldReadFunction +}; export type ProductVariantChannelListingKeySpecifier = ('id' | 'channel' | 'price' | 'costPrice' | 'margin' | 'preorderThreshold' | ProductVariantChannelListingKeySpecifier)[]; export type ProductVariantChannelListingFieldPolicy = { id?: FieldPolicy | FieldReadFunction, @@ -3988,6 +4024,15 @@ export type ProductVariantSetDefaultFieldPolicy = { productErrors?: FieldPolicy | FieldReadFunction, errors?: FieldPolicy | FieldReadFunction }; +export type ProductVariantStockUpdatedKeySpecifier = ('issuedAt' | 'version' | 'issuingPrincipal' | 'recipient' | 'productVariant' | 'warehouse' | ProductVariantStockUpdatedKeySpecifier)[]; +export type ProductVariantStockUpdatedFieldPolicy = { + issuedAt?: FieldPolicy | FieldReadFunction, + version?: FieldPolicy | FieldReadFunction, + issuingPrincipal?: FieldPolicy | FieldReadFunction, + recipient?: FieldPolicy | FieldReadFunction, + productVariant?: FieldPolicy | FieldReadFunction, + warehouse?: FieldPolicy | FieldReadFunction +}; export type ProductVariantStocksCreateKeySpecifier = ('productVariant' | 'bulkStockErrors' | 'errors' | ProductVariantStocksCreateKeySpecifier)[]; export type ProductVariantStocksCreateFieldPolicy = { productVariant?: FieldPolicy | FieldReadFunction, @@ -7378,6 +7423,18 @@ export type StrictTypedTypePolicies = { keyFields?: false | ProductVariantBulkDeleteKeySpecifier | (() => undefined | ProductVariantBulkDeleteKeySpecifier), fields?: ProductVariantBulkDeleteFieldPolicy, }, + ProductVariantBulkError?: Omit & { + keyFields?: false | ProductVariantBulkErrorKeySpecifier | (() => undefined | ProductVariantBulkErrorKeySpecifier), + fields?: ProductVariantBulkErrorFieldPolicy, + }, + ProductVariantBulkResult?: Omit & { + keyFields?: false | ProductVariantBulkResultKeySpecifier | (() => undefined | ProductVariantBulkResultKeySpecifier), + fields?: ProductVariantBulkResultFieldPolicy, + }, + ProductVariantBulkUpdate?: Omit & { + keyFields?: false | ProductVariantBulkUpdateKeySpecifier | (() => undefined | ProductVariantBulkUpdateKeySpecifier), + fields?: ProductVariantBulkUpdateFieldPolicy, + }, ProductVariantChannelListing?: Omit & { keyFields?: false | ProductVariantChannelListingKeySpecifier | (() => undefined | ProductVariantChannelListingKeySpecifier), fields?: ProductVariantChannelListingFieldPolicy, @@ -7434,6 +7491,10 @@ export type StrictTypedTypePolicies = { keyFields?: false | ProductVariantSetDefaultKeySpecifier | (() => undefined | ProductVariantSetDefaultKeySpecifier), fields?: ProductVariantSetDefaultFieldPolicy, }, + ProductVariantStockUpdated?: Omit & { + keyFields?: false | ProductVariantStockUpdatedKeySpecifier | (() => undefined | ProductVariantStockUpdatedKeySpecifier), + fields?: ProductVariantStockUpdatedFieldPolicy, + }, ProductVariantStocksCreate?: Omit & { keyFields?: false | ProductVariantStocksCreateKeySpecifier | (() => undefined | ProductVariantStocksCreateKeySpecifier), fields?: ProductVariantStocksCreateFieldPolicy, diff --git a/src/graphql/types.generated.ts b/src/graphql/types.generated.ts index 7fd101484..949cc42ff 100644 --- a/src/graphql/types.generated.ts +++ b/src/graphql/types.generated.ts @@ -321,13 +321,25 @@ export type AttributeCreateInput = { isVariantOnly?: InputMaybe; /** Whether the attribute should be visible or not in storefront. */ visibleInStorefront?: InputMaybe; - /** Whether the attribute can be filtered in storefront. */ + /** + * Whether the attribute can be filtered in storefront. + * + * DEPRECATED: this field will be removed in Saleor 4.0. + */ filterableInStorefront?: InputMaybe; /** Whether the attribute can be filtered in dashboard. */ filterableInDashboard?: InputMaybe; - /** The position of the attribute in the storefront navigation (0 by default). */ + /** + * The position of the attribute in the storefront navigation (0 by default). + * + * DEPRECATED: this field will be removed in Saleor 4.0. + */ storefrontSearchPosition?: InputMaybe; - /** Whether the attribute can be displayed in the admin product list. */ + /** + * Whether the attribute can be displayed in the admin product list. + * + * DEPRECATED: this field will be removed in Saleor 4.0. + */ availableInGrid?: InputMaybe; /** * External ID of this attribute. @@ -344,6 +356,13 @@ export enum AttributeEntityTypeEnum { PRODUCT_VARIANT = 'PRODUCT_VARIANT' } +export type AttributeEntityTypeEnumFilterInput = { + /** The value equal to. */ + eq?: InputMaybe; + /** The value included in. */ + oneOf?: InputMaybe>; +}; + /** An enumeration. */ export enum AttributeErrorCode { ALREADY_EXISTS = 'ALREADY_EXISTS', @@ -406,6 +425,13 @@ export enum AttributeInputTypeEnum { DATE_TIME = 'DATE_TIME' } +export type AttributeInputTypeEnumFilterInput = { + /** The value equal to. */ + eq?: InputMaybe; + /** The value included in. */ + oneOf?: InputMaybe>; +}; + export enum AttributeSortField { /** Sort attributes by name */ NAME = 'NAME', @@ -440,6 +466,13 @@ export enum AttributeTypeEnum { PAGE_TYPE = 'PAGE_TYPE' } +export type AttributeTypeEnumFilterInput = { + /** The value equal to. */ + eq?: InputMaybe; + /** The value included in. */ + oneOf?: InputMaybe>; +}; + export type AttributeUpdateInput = { /** Name of an attribute displayed in the interface. */ name?: InputMaybe; @@ -457,13 +490,25 @@ export type AttributeUpdateInput = { isVariantOnly?: InputMaybe; /** Whether the attribute should be visible or not in storefront. */ visibleInStorefront?: InputMaybe; - /** Whether the attribute can be filtered in storefront. */ + /** + * Whether the attribute can be filtered in storefront. + * + * DEPRECATED: this field will be removed in Saleor 4.0. + */ filterableInStorefront?: InputMaybe; /** Whether the attribute can be filtered in dashboard. */ filterableInDashboard?: InputMaybe; - /** The position of the attribute in the storefront navigation (0 by default). */ + /** + * The position of the attribute in the storefront navigation (0 by default). + * + * DEPRECATED: this field will be removed in Saleor 4.0. + */ storefrontSearchPosition?: InputMaybe; - /** Whether the attribute can be displayed in the admin product list. */ + /** + * Whether the attribute can be displayed in the admin product list. + * + * DEPRECATED: this field will be removed in Saleor 4.0. + */ availableInGrid?: InputMaybe; /** * External ID of this product. @@ -520,6 +565,12 @@ export type AttributeValueInput = { * Added in Saleor 3.9. */ dropdown?: InputMaybe; + /** + * Attribute value ID. + * + * Added in Saleor 3.9. + */ + swatch?: InputMaybe; /** * List of attribute value IDs. * @@ -605,6 +656,34 @@ export type AttributeValueUpdateInput = { name?: InputMaybe; }; +/** + * Where filtering options. + * + * Added in Saleor 3.11. + * + * Note: this API is currently in Feature Preview and can be subject to changes at later point. + */ +export type AttributeWhereInput = { + valueRequired?: InputMaybe; + visibleInStorefront?: InputMaybe; + filterableInDashboard?: InputMaybe; + metadata?: InputMaybe>; + ids?: InputMaybe>; + name?: InputMaybe; + slug?: InputMaybe; + withChoices?: InputMaybe; + inputType?: InputMaybe; + entityType?: InputMaybe; + type?: InputMaybe; + unit?: InputMaybe; + inCollection?: InputMaybe; + inCategory?: InputMaybe; + /** List of conditions that must be met. */ + AND?: InputMaybe>; + /** A list of conditions of which at least one must be met. */ + OR?: InputMaybe>; +}; + export type BulkAttributeValueInput = { /** ID of the selected attribute. */ id?: InputMaybe; @@ -753,6 +832,17 @@ export enum ChannelErrorCode { DUPLICATED_INPUT_ITEM = 'DUPLICATED_INPUT_ITEM' } +export type ChannelListingUpdateInput = { + /** ID of a channel listing. */ + channelListing: Scalars['ID']; + /** Price of the particular variant in channel. */ + price?: InputMaybe; + /** Cost price of the variant in channel. */ + costPrice?: InputMaybe; + /** The threshold for preorder variant in channel. */ + preorderThreshold?: InputMaybe; +}; + export type ChannelUpdateInput = { /** isActive flag. */ isActive?: InputMaybe; @@ -1610,6 +1700,15 @@ export type DraftOrderInput = { externalReference?: InputMaybe; }; +export enum ErrorPolicyEnum { + /** Save what is possible within a single row. If there are errors in an input data row, try to save it partially and skip the invalid part. */ + IGNORE_FAILED = 'IGNORE_FAILED', + /** Reject all rows if there is at least one error in any of them. */ + REJECT_EVERYTHING = 'REJECT_EVERYTHING', + /** Reject rows with errors. */ + REJECT_FAILED_ROWS = 'REJECT_FAILED_ROWS' +} + export enum EventDeliveryAttemptSortField { /** Sort event delivery attempts by created at. */ CREATED_AT = 'CREATED_AT' @@ -2857,6 +2956,13 @@ export enum MeasurementUnitsEnum { TONNE = 'TONNE' } +export type MeasurementUnitsEnumFilterInput = { + /** The value equal to. */ + eq?: InputMaybe; + /** The value included in. */ + oneOf?: InputMaybe>; +}; + export enum MediaChoicesSortField { /** Sort media by ID. */ ID = 'ID' @@ -3246,6 +3352,7 @@ export type OrderFilterInput = { giftCardUsed?: InputMaybe; giftCardBought?: InputMaybe; numbers?: InputMaybe>; + checkoutIds?: InputMaybe>; }; export type OrderFulfillInput = { @@ -3993,6 +4100,7 @@ export enum ProductErrorCode { DUPLICATED_INPUT_ITEM = 'DUPLICATED_INPUT_ITEM', GRAPHQL_ERROR = 'GRAPHQL_ERROR', INVALID = 'INVALID', + INVALID_PRICE = 'INVALID_PRICE', PRODUCT_WITHOUT_CATEGORY = 'PRODUCT_WITHOUT_CATEGORY', NOT_PRODUCTS_IMAGE = 'NOT_PRODUCTS_IMAGE', NOT_PRODUCTS_VARIANT = 'NOT_PRODUCTS_VARIANT', @@ -4358,6 +4466,80 @@ export type ProductVariantBulkCreateInput = { channelListings?: InputMaybe>; }; +/** An enumeration. */ +export enum ProductVariantBulkErrorCode { + ATTRIBUTE_ALREADY_ASSIGNED = 'ATTRIBUTE_ALREADY_ASSIGNED', + ATTRIBUTE_CANNOT_BE_ASSIGNED = 'ATTRIBUTE_CANNOT_BE_ASSIGNED', + ATTRIBUTE_VARIANTS_DISABLED = 'ATTRIBUTE_VARIANTS_DISABLED', + DUPLICATED_INPUT_ITEM = 'DUPLICATED_INPUT_ITEM', + GRAPHQL_ERROR = 'GRAPHQL_ERROR', + INVALID = 'INVALID', + INVALID_PRICE = 'INVALID_PRICE', + NOT_PRODUCTS_VARIANT = 'NOT_PRODUCTS_VARIANT', + NOT_FOUND = 'NOT_FOUND', + REQUIRED = 'REQUIRED', + UNIQUE = 'UNIQUE', + PRODUCT_NOT_ASSIGNED_TO_CHANNEL = 'PRODUCT_NOT_ASSIGNED_TO_CHANNEL' +} + +/** + * Input fields to update product variants. + * + * Added in Saleor 3.11. + */ +export type ProductVariantBulkUpdateInput = { + /** List of attributes specific to this variant. */ + attributes?: InputMaybe>; + /** Stock keeping unit. */ + sku?: InputMaybe; + /** Variant name. */ + name?: InputMaybe; + /** Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. */ + trackInventory?: InputMaybe; + /** Weight of the Product Variant. */ + weight?: InputMaybe; + /** + * Determines if variant is in preorder. + * + * Added in Saleor 3.1. + * + * Note: this API is currently in Feature Preview and can be subject to changes at later point. + */ + preorder?: InputMaybe; + /** + * Determines maximum quantity of `ProductVariant`,that can be bought in a single checkout. + * + * Added in Saleor 3.1. + * + * Note: this API is currently in Feature Preview and can be subject to changes at later point. + */ + quantityLimitPerCustomer?: InputMaybe; + /** + * Fields required to update the product variant metadata. + * + * Added in Saleor 3.8. + */ + metadata?: InputMaybe>; + /** + * Fields required to update the product variant private metadata. + * + * Added in Saleor 3.8. + */ + privateMetadata?: InputMaybe>; + /** + * External ID of this product variant. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; + /** Stocks input. */ + stocks?: InputMaybe; + /** Channel listings input. */ + channelListings?: InputMaybe; + /** ID of the product variant to update. */ + id: Scalars['ID']; +}; + export type ProductVariantChannelListingAddInput = { /** ID of a channel. */ channelId: Scalars['ID']; @@ -4375,6 +4557,15 @@ export type ProductVariantChannelListingAddInput = { preorderThreshold?: InputMaybe; }; +export type ProductVariantChannelListingUpdateInput = { + /** List of channels to create variant channel listings. */ + create?: InputMaybe>; + /** List of channel listings to update. */ + update?: InputMaybe>; + /** List of product variant channel listings to remove. */ + remove?: InputMaybe>; +}; + export type ProductVariantCreateInput = { /** List of attributes specific to this variant. */ attributes: Array; @@ -4493,6 +4684,15 @@ export type ProductVariantSortingInput = { field: ProductVariantSortField; }; +export type ProductVariantStocksUpdateInput = { + /** List of warehouses to create stocks. */ + create?: InputMaybe>; + /** List od stocks that should be updated. */ + update?: InputMaybe>; + /** List of stocks to remove. */ + remove?: InputMaybe>; +}; + export type PublishableChannelListingInput = { /** ID of a channel. */ channelId: Scalars['ID']; @@ -4921,6 +5121,13 @@ export type StockSettingsInput = { allocationStrategy: AllocationStrategyEnum; }; +export type StockUpdateInput = { + /** Stock. */ + stock: Scalars['ID']; + /** Quantity of items available for sell. */ + quantity: Scalars['Int']; +}; + /** Enum representing the type of a payment storage in a gateway. */ export enum StorePaymentMethodEnum { /** On session storage type. The payment is stored only to be reused when the customer is present in the checkout flow. */ @@ -4931,6 +5138,20 @@ export enum StorePaymentMethodEnum { NONE = 'NONE' } +/** + * Define the filtering options for string fields. + * + * Added in Saleor 3.11. + * + * Note: this API is currently in Feature Preview and can be subject to changes at later point. + */ +export type StringFilterInput = { + /** The value equal to. */ + eq?: InputMaybe; + /** The value included in. */ + oneOf?: InputMaybe>; +}; + export enum TaxCalculationStrategy { FLAT_RATES = 'FLAT_RATES', TAX_APP = 'TAX_APP' @@ -5566,9 +5787,11 @@ export type WebhookCreateInput = { /** An enumeration. */ export enum WebhookDryRunErrorCode { GRAPHQL_ERROR = 'GRAPHQL_ERROR', + UNABLE_TO_PARSE = 'UNABLE_TO_PARSE', NOT_FOUND = 'NOT_FOUND', INVALID_ID = 'INVALID_ID', - MISSING_PERMISSION = 'MISSING_PERMISSION' + MISSING_PERMISSION = 'MISSING_PERMISSION', + TYPE_NOT_SUPPORTED = 'TYPE_NOT_SUPPORTED' } /** An enumeration. */ @@ -5745,6 +5968,8 @@ export enum WebhookEventTypeAsyncEnum { PRODUCT_VARIANT_OUT_OF_STOCK = 'PRODUCT_VARIANT_OUT_OF_STOCK', /** A product variant is back in stock. */ PRODUCT_VARIANT_BACK_IN_STOCK = 'PRODUCT_VARIANT_BACK_IN_STOCK', + /** A product variant stock is updated */ + PRODUCT_VARIANT_STOCK_UPDATED = 'PRODUCT_VARIANT_STOCK_UPDATED', /** * A product variant metadata is updated. * @@ -6035,6 +6260,8 @@ export enum WebhookEventTypeEnum { PRODUCT_VARIANT_OUT_OF_STOCK = 'PRODUCT_VARIANT_OUT_OF_STOCK', /** A product variant is back in stock. */ PRODUCT_VARIANT_BACK_IN_STOCK = 'PRODUCT_VARIANT_BACK_IN_STOCK', + /** A product variant stock is updated */ + PRODUCT_VARIANT_STOCK_UPDATED = 'PRODUCT_VARIANT_STOCK_UPDATED', /** * A product variant metadata is updated. * @@ -6304,6 +6531,7 @@ export enum WebhookSampleEventTypeEnum { PRODUCT_VARIANT_DELETED = 'PRODUCT_VARIANT_DELETED', PRODUCT_VARIANT_OUT_OF_STOCK = 'PRODUCT_VARIANT_OUT_OF_STOCK', PRODUCT_VARIANT_BACK_IN_STOCK = 'PRODUCT_VARIANT_BACK_IN_STOCK', + PRODUCT_VARIANT_STOCK_UPDATED = 'PRODUCT_VARIANT_STOCK_UPDATED', PRODUCT_VARIANT_METADATA_UPDATED = 'PRODUCT_VARIANT_METADATA_UPDATED', CHECKOUT_CREATED = 'CHECKOUT_CREATED', CHECKOUT_UPDATED = 'CHECKOUT_UPDATED', @@ -6353,7 +6581,9 @@ export enum WebhookTriggerErrorCode { NOT_FOUND = 'NOT_FOUND', INVALID_ID = 'INVALID_ID', MISSING_PERMISSION = 'MISSING_PERMISSION', - MISSING_QUERY = 'MISSING_QUERY' + MISSING_QUERY = 'MISSING_QUERY', + TYPE_NOT_SUPPORTED = 'TYPE_NOT_SUPPORTED', + UNABLE_TO_PARSE = 'UNABLE_TO_PARSE' } export type WebhookUpdateInput = { @@ -7318,6 +7548,8 @@ export type PermissionGroupErrorFragment = { __typename: 'PermissionGroupError', export type BulkProductErrorFragment = { __typename: 'BulkProductError', field: string | null, code: ProductErrorCode, index: number | null, channels: Array | null, message: string | null }; +export type ProductVariantBulkErrorFragment = { __typename: 'ProductVariantBulkError', field: string | null, code: ProductVariantBulkErrorCode, message: string | null, attributes: Array | null, values: Array | null, warehouses: Array | null, channels: Array | null }; + export type BulkStockErrorFragment = { __typename: 'BulkStockError', code: ProductErrorCode, field: string | null, index: number | null, message: string | null }; export type StockErrorFragment = { __typename: 'StockError', code: StockErrorCode, field: string | null, message: string | null }; @@ -7432,6 +7664,8 @@ export type CustomerGiftCardFragment = { __typename: 'GiftCard', id: string, las export type MetadataItemFragment = { __typename: 'MetadataItem', key: string, value: string }; +type Metadata_Address_Fragment = { __typename: 'Address', metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> }; + type Metadata_App_Fragment = { __typename: 'App', metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> }; type Metadata_Attribute_Fragment = { __typename: 'Attribute', metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> }; @@ -7492,7 +7726,7 @@ type Metadata_Voucher_Fragment = { __typename: 'Voucher', metadata: Array<{ __ty type Metadata_Warehouse_Fragment = { __typename: 'Warehouse', metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> }; -export type MetadataFragment = Metadata_App_Fragment | Metadata_Attribute_Fragment | Metadata_Category_Fragment | Metadata_Checkout_Fragment | Metadata_CheckoutLine_Fragment | Metadata_Collection_Fragment | Metadata_DigitalContent_Fragment | Metadata_Fulfillment_Fragment | Metadata_GiftCard_Fragment | Metadata_Invoice_Fragment | Metadata_Menu_Fragment | Metadata_MenuItem_Fragment | Metadata_Order_Fragment | Metadata_OrderLine_Fragment | Metadata_Page_Fragment | Metadata_PageType_Fragment | Metadata_Payment_Fragment | Metadata_Product_Fragment | Metadata_ProductType_Fragment | Metadata_ProductVariant_Fragment | Metadata_Sale_Fragment | Metadata_ShippingMethod_Fragment | Metadata_ShippingMethodType_Fragment | Metadata_ShippingZone_Fragment | Metadata_TaxClass_Fragment | Metadata_TaxConfiguration_Fragment | Metadata_TransactionItem_Fragment | Metadata_User_Fragment | Metadata_Voucher_Fragment | Metadata_Warehouse_Fragment; +export type MetadataFragment = Metadata_Address_Fragment | Metadata_App_Fragment | Metadata_Attribute_Fragment | Metadata_Category_Fragment | Metadata_Checkout_Fragment | Metadata_CheckoutLine_Fragment | Metadata_Collection_Fragment | Metadata_DigitalContent_Fragment | Metadata_Fulfillment_Fragment | Metadata_GiftCard_Fragment | Metadata_Invoice_Fragment | Metadata_Menu_Fragment | Metadata_MenuItem_Fragment | Metadata_Order_Fragment | Metadata_OrderLine_Fragment | Metadata_Page_Fragment | Metadata_PageType_Fragment | Metadata_Payment_Fragment | Metadata_Product_Fragment | Metadata_ProductType_Fragment | Metadata_ProductVariant_Fragment | Metadata_Sale_Fragment | Metadata_ShippingMethod_Fragment | Metadata_ShippingMethodType_Fragment | Metadata_ShippingZone_Fragment | Metadata_TaxClass_Fragment | Metadata_TaxConfiguration_Fragment | Metadata_TransactionItem_Fragment | Metadata_User_Fragment | Metadata_Voucher_Fragment | Metadata_Warehouse_Fragment; export type MenuFragment = { __typename: 'Menu', id: string, name: string, items: Array<{ __typename: 'MenuItem', id: string }> | null }; @@ -7572,21 +7806,21 @@ export type ChannelListingProductWithoutPricingFragment = { __typename: 'Product export type ChannelListingProductFragment = { __typename: 'ProductChannelListing', isPublished: boolean, publicationDate: any | null, isAvailableForPurchase: boolean | null, availableForPurchase: any | null, visibleInListings: boolean, pricing: { __typename: 'ProductPricingInfo', priceRange: { __typename: 'TaxedMoneyRange', start: { __typename: 'TaxedMoney', net: { __typename: 'Money', amount: number, currency: string } } | null, stop: { __typename: 'TaxedMoney', net: { __typename: 'Money', amount: number, currency: string } } | null } | null } | null, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }; -export type ChannelListingProductVariantFragment = { __typename: 'ProductVariantChannelListing', channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }; +export type ChannelListingProductVariantFragment = { __typename: 'ProductVariantChannelListing', id: string, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }; export type ProductWithChannelListingsFragment = { __typename: 'Product', id: string, name: string, thumbnail: { __typename: 'Image', url: string } | null, productType: { __typename: 'ProductType', id: string, name: string, hasVariants: boolean }, channelListings: Array<{ __typename: 'ProductChannelListing', isPublished: boolean, publicationDate: any | null, isAvailableForPurchase: boolean | null, availableForPurchase: any | null, visibleInListings: boolean, pricing?: { __typename: 'ProductPricingInfo', priceRange: { __typename: 'TaxedMoneyRange', start: { __typename: 'TaxedMoney', net: { __typename: 'Money', amount: number, currency: string } } | null, stop: { __typename: 'TaxedMoney', net: { __typename: 'Money', amount: number, currency: string } } | null } | null } | null, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null }; export type ProductVariantAttributesFragment = { __typename: 'Product', id: string, attributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, slug: string | null, name: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, productType: { __typename: 'ProductType', id: string, variantAttributes: Array<{ __typename: 'Attribute', id: string, name: string | null, inputType: AttributeInputTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }> | null }, channelListings: Array<{ __typename: 'ProductChannelListing', channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null }; -export type ProductDetailsVariantFragment = { __typename: 'ProductVariant', id: string, sku: string | null, name: string, trackInventory: boolean, quantityLimitPerCustomer: number | null, attributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null }, values: Array<{ __typename: 'AttributeValue', id: string, name: string | null }> }>, media: Array<{ __typename: 'ProductMedia', url: string }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, channelListings: Array<{ __typename: 'ProductVariantChannelListing', channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null }; +export type ProductDetailsVariantFragment = { __typename: 'ProductVariant', id: string, sku: string | null, name: string, trackInventory: boolean, quantityLimitPerCustomer: number | null, attributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null }, values: Array<{ __typename: 'AttributeValue', id: string, name: string | null }> }>, media: Array<{ __typename: 'ProductMedia', url: string }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, channelListings: Array<{ __typename: 'ProductVariantChannelListing', id: string, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null }; -export type ProductFragment = { __typename: 'Product', name: string, slug: string, description: any | null, seoTitle: string | null, seoDescription: string | null, rating: number | null, isAvailable: boolean | null, id: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, category: { __typename: 'Category', id: string, name: string } | null, collections: Array<{ __typename: 'Collection', id: string, name: string }> | null, channelListings: Array<{ __typename: 'ProductChannelListing', isPublished: boolean, publicationDate: any | null, isAvailableForPurchase: boolean | null, availableForPurchase: any | null, visibleInListings: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, sku: string | null, name: string, trackInventory: boolean, quantityLimitPerCustomer: number | null, attributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null }, values: Array<{ __typename: 'AttributeValue', id: string, name: string | null }> }>, media: Array<{ __typename: 'ProductMedia', url: string }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, channelListings: Array<{ __typename: 'ProductVariantChannelListing', channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null }> | null, productType: { __typename: 'ProductType', id: string, name: string, hasVariants: boolean, variantAttributes: Array<{ __typename: 'Attribute', id: string, name: string | null, inputType: AttributeInputTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }> | null }, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, taxClass: { __typename: 'TaxClass', id: string, name: string } | null, attributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, slug: string | null, name: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> }; +export type ProductFragment = { __typename: 'Product', name: string, slug: string, description: any | null, seoTitle: string | null, seoDescription: string | null, rating: number | null, isAvailable: boolean | null, id: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, category: { __typename: 'Category', id: string, name: string } | null, collections: Array<{ __typename: 'Collection', id: string, name: string }> | null, channelListings: Array<{ __typename: 'ProductChannelListing', isPublished: boolean, publicationDate: any | null, isAvailableForPurchase: boolean | null, availableForPurchase: any | null, visibleInListings: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, sku: string | null, name: string, trackInventory: boolean, quantityLimitPerCustomer: number | null, attributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null }, values: Array<{ __typename: 'AttributeValue', id: string, name: string | null }> }>, media: Array<{ __typename: 'ProductMedia', url: string }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, channelListings: Array<{ __typename: 'ProductVariantChannelListing', id: string, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null }> | null, productType: { __typename: 'ProductType', id: string, name: string, hasVariants: boolean, variantAttributes: Array<{ __typename: 'Attribute', id: string, name: string | null, inputType: AttributeInputTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }> | null }, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, taxClass: { __typename: 'TaxClass', id: string, name: string } | null, attributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, slug: string | null, name: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> }; export type VariantAttributeFragment = { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }; export type SelectedVariantAttributeFragment = { __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }; -export type ProductVariantFragment = { __typename: 'ProductVariant', id: string, name: string, sku: string | null, trackInventory: boolean, quantityLimitPerCustomer: number | null, selectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, nonSelectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null, product: { __typename: 'Product', id: string, name: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, thumbnail: { __typename: 'Image', url: string } | null, channelListings: Array<{ __typename: 'ProductChannelListing', id: string, publicationDate: any | null, isPublished: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, name: string, sku: string | null, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null }> | null }, channelListings: Array<{ __typename: 'ProductVariantChannelListing', channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> }; +export type ProductVariantFragment = { __typename: 'ProductVariant', id: string, name: string, sku: string | null, trackInventory: boolean, quantityLimitPerCustomer: number | null, selectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, nonSelectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null, product: { __typename: 'Product', id: string, name: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, thumbnail: { __typename: 'Image', url: string } | null, channelListings: Array<{ __typename: 'ProductChannelListing', id: string, publicationDate: any | null, isPublished: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, name: string, sku: string | null, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null }> | null }, channelListings: Array<{ __typename: 'ProductVariantChannelListing', id: string, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> }; export type ExportFileFragment = { __typename: 'ExportFile', id: string, status: JobStatusEnum, url: string | null }; @@ -8557,31 +8791,6 @@ export type VariantDeleteMutationVariables = Exact<{ export type VariantDeleteMutation = { __typename: 'Mutation', productVariantDelete: { __typename: 'ProductVariantDelete', errors: Array<{ __typename: 'ProductError', code: ProductErrorCode, field: string | null, message: string | null }>, productVariant: { __typename: 'ProductVariant', id: string } | null } | null }; -export type VariantDatagridUpdateMutationVariables = Exact<{ - id: Scalars['ID']; - input: ProductVariantInput; -}>; - - -export type VariantDatagridUpdateMutation = { __typename: 'Mutation', productVariantUpdate: { __typename: 'ProductVariantUpdate', errors: Array<{ __typename: 'ProductError', attributes: Array | null, code: ProductErrorCode, field: string | null, message: string | null }> } | null }; - -export type VariantDatagridStockUpdateMutationVariables = Exact<{ - stocks: Array | StockInput; - removeStocks: Array | Scalars['ID']; - id: Scalars['ID']; -}>; - - -export type VariantDatagridStockUpdateMutation = { __typename: 'Mutation', productVariantStocksDelete: { __typename: 'ProductVariantStocksDelete', errors: Array<{ __typename: 'StockError', code: StockErrorCode, field: string | null, message: string | null }> } | null, productVariantStocksUpdate: { __typename: 'ProductVariantStocksUpdate', errors: Array<{ __typename: 'BulkStockError', code: ProductErrorCode, field: string | null, index: number | null, message: string | null }> } | null }; - -export type VariantDatagridChannelListingUpdateMutationVariables = Exact<{ - id: Scalars['ID']; - input: Array | ProductVariantChannelListingAddInput; -}>; - - -export type VariantDatagridChannelListingUpdateMutation = { __typename: 'Mutation', productVariantChannelListingUpdate: { __typename: 'ProductVariantChannelListingUpdate', errors: Array<{ __typename: 'ProductChannelListingError', code: ProductErrorCode, field: string | null, message: string | null, channels: Array | null }> } | null }; - export type VariantUpdateMutationVariables = Exact<{ addStocks: Array | StockInput; removeStocks: Array | Scalars['ID']; @@ -8601,7 +8810,7 @@ export type VariantUpdateMutationVariables = Exact<{ }>; -export type VariantUpdateMutation = { __typename: 'Mutation', productVariantStocksDelete: { __typename: 'ProductVariantStocksDelete', errors: Array<{ __typename: 'StockError', code: StockErrorCode, field: string | null, message: string | null }>, productVariant: { __typename: 'ProductVariant', id: string, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null } | null } | null, productVariantStocksCreate: { __typename: 'ProductVariantStocksCreate', errors: Array<{ __typename: 'BulkStockError', code: ProductErrorCode, field: string | null, index: number | null, message: string | null }>, productVariant: { __typename: 'ProductVariant', id: string, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null } | null } | null, productVariantStocksUpdate: { __typename: 'ProductVariantStocksUpdate', errors: Array<{ __typename: 'BulkStockError', code: ProductErrorCode, field: string | null, index: number | null, message: string | null }>, productVariant: { __typename: 'ProductVariant', id: string, name: string, sku: string | null, trackInventory: boolean, quantityLimitPerCustomer: number | null, selectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, nonSelectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null, product: { __typename: 'Product', id: string, name: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, thumbnail: { __typename: 'Image', url: string } | null, channelListings: Array<{ __typename: 'ProductChannelListing', id: string, publicationDate: any | null, isPublished: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, name: string, sku: string | null, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null }> | null }, channelListings: Array<{ __typename: 'ProductVariantChannelListing', channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null, productVariantUpdate: { __typename: 'ProductVariantUpdate', errors: Array<{ __typename: 'ProductError', attributes: Array | null, code: ProductErrorCode, field: string | null, message: string | null }>, productVariant: { __typename: 'ProductVariant', id: string, name: string, sku: string | null, trackInventory: boolean, quantityLimitPerCustomer: number | null, selectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, nonSelectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null, product: { __typename: 'Product', id: string, name: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, thumbnail: { __typename: 'Image', url: string } | null, channelListings: Array<{ __typename: 'ProductChannelListing', id: string, publicationDate: any | null, isPublished: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, name: string, sku: string | null, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null }> | null }, channelListings: Array<{ __typename: 'ProductVariantChannelListing', channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null }; +export type VariantUpdateMutation = { __typename: 'Mutation', productVariantStocksDelete: { __typename: 'ProductVariantStocksDelete', errors: Array<{ __typename: 'StockError', code: StockErrorCode, field: string | null, message: string | null }>, productVariant: { __typename: 'ProductVariant', id: string, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null } | null } | null, productVariantStocksCreate: { __typename: 'ProductVariantStocksCreate', errors: Array<{ __typename: 'BulkStockError', code: ProductErrorCode, field: string | null, index: number | null, message: string | null }>, productVariant: { __typename: 'ProductVariant', id: string, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null } | null } | null, productVariantStocksUpdate: { __typename: 'ProductVariantStocksUpdate', errors: Array<{ __typename: 'BulkStockError', code: ProductErrorCode, field: string | null, index: number | null, message: string | null }>, productVariant: { __typename: 'ProductVariant', id: string, name: string, sku: string | null, trackInventory: boolean, quantityLimitPerCustomer: number | null, selectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, nonSelectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null, product: { __typename: 'Product', id: string, name: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, thumbnail: { __typename: 'Image', url: string } | null, channelListings: Array<{ __typename: 'ProductChannelListing', id: string, publicationDate: any | null, isPublished: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, name: string, sku: string | null, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null }> | null }, channelListings: Array<{ __typename: 'ProductVariantChannelListing', id: string, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null, productVariantUpdate: { __typename: 'ProductVariantUpdate', errors: Array<{ __typename: 'ProductError', attributes: Array | null, code: ProductErrorCode, field: string | null, message: string | null }>, productVariant: { __typename: 'ProductVariant', id: string, name: string, sku: string | null, trackInventory: boolean, quantityLimitPerCustomer: number | null, selectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, nonSelectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null, product: { __typename: 'Product', id: string, name: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, thumbnail: { __typename: 'Image', url: string } | null, channelListings: Array<{ __typename: 'ProductChannelListing', id: string, publicationDate: any | null, isPublished: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, name: string, sku: string | null, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null }> | null }, channelListings: Array<{ __typename: 'ProductVariantChannelListing', id: string, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null }; export type VariantCreateMutationVariables = Exact<{ input: ProductVariantCreateInput; @@ -8612,7 +8821,7 @@ export type VariantCreateMutationVariables = Exact<{ }>; -export type VariantCreateMutation = { __typename: 'Mutation', productVariantCreate: { __typename: 'ProductVariantCreate', errors: Array<{ __typename: 'ProductError', attributes: Array | null, code: ProductErrorCode, field: string | null, message: string | null }>, productVariant: { __typename: 'ProductVariant', id: string, name: string, sku: string | null, trackInventory: boolean, quantityLimitPerCustomer: number | null, selectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, nonSelectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null, product: { __typename: 'Product', id: string, name: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, thumbnail: { __typename: 'Image', url: string } | null, channelListings: Array<{ __typename: 'ProductChannelListing', id: string, publicationDate: any | null, isPublished: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, name: string, sku: string | null, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null }> | null }, channelListings: Array<{ __typename: 'ProductVariantChannelListing', channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null }; +export type VariantCreateMutation = { __typename: 'Mutation', productVariantCreate: { __typename: 'ProductVariantCreate', errors: Array<{ __typename: 'ProductError', attributes: Array | null, code: ProductErrorCode, field: string | null, message: string | null }>, productVariant: { __typename: 'ProductVariant', id: string, name: string, sku: string | null, trackInventory: boolean, quantityLimitPerCustomer: number | null, selectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, nonSelectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null, product: { __typename: 'Product', id: string, name: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, thumbnail: { __typename: 'Image', url: string } | null, channelListings: Array<{ __typename: 'ProductChannelListing', id: string, publicationDate: any | null, isPublished: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, name: string, sku: string | null, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null }> | null }, channelListings: Array<{ __typename: 'ProductVariantChannelListing', id: string, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null }; export type ProductMediaDeleteMutationVariables = Exact<{ id: Scalars['ID']; @@ -8696,7 +8905,7 @@ export type ProductVariantChannelListingUpdateMutationVariables = Exact<{ }>; -export type ProductVariantChannelListingUpdateMutation = { __typename: 'Mutation', productVariantChannelListingUpdate: { __typename: 'ProductVariantChannelListingUpdate', variant: { __typename: 'ProductVariant', id: string, channelListings: Array<{ __typename: 'ProductVariantChannelListing', channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null, product: { __typename: 'Product', id: string, channelListings: Array<{ __typename: 'ProductChannelListing', isPublished: boolean, publicationDate: any | null, isAvailableForPurchase: boolean | null, availableForPurchase: any | null, visibleInListings: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null } } | null, errors: Array<{ __typename: 'ProductChannelListingError', code: ProductErrorCode, field: string | null, message: string | null, channels: Array | null }> } | null }; +export type ProductVariantChannelListingUpdateMutation = { __typename: 'Mutation', productVariantChannelListingUpdate: { __typename: 'ProductVariantChannelListingUpdate', variant: { __typename: 'ProductVariant', id: string, channelListings: Array<{ __typename: 'ProductVariantChannelListing', id: string, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null, product: { __typename: 'Product', id: string, channelListings: Array<{ __typename: 'ProductChannelListing', isPublished: boolean, publicationDate: any | null, isAvailableForPurchase: boolean | null, availableForPurchase: any | null, visibleInListings: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null } } | null, errors: Array<{ __typename: 'ProductChannelListingError', code: ProductErrorCode, field: string | null, message: string | null, channels: Array | null }> } | null }; export type ProductVariantPreorderDeactivateMutationVariables = Exact<{ id: Scalars['ID']; @@ -8705,6 +8914,15 @@ export type ProductVariantPreorderDeactivateMutationVariables = Exact<{ export type ProductVariantPreorderDeactivateMutation = { __typename: 'Mutation', productVariantPreorderDeactivate: { __typename: 'ProductVariantPreorderDeactivate', productVariant: { __typename: 'ProductVariant', id: string, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null } | null, errors: Array<{ __typename: 'ProductError', code: ProductErrorCode, field: string | null, message: string | null }> } | null }; +export type ProductVariantBulkUpdateMutationVariables = Exact<{ + product: Scalars['ID']; + input: Array | ProductVariantBulkUpdateInput; + errorPolicy?: InputMaybe; +}>; + + +export type ProductVariantBulkUpdateMutation = { __typename: 'Mutation', productVariantBulkUpdate: { __typename: 'ProductVariantBulkUpdate', errors: Array<{ __typename: 'ProductVariantBulkError', field: string | null, code: ProductVariantBulkErrorCode, message: string | null, attributes: Array | null, values: Array | null, warehouses: Array | null, channels: Array | null }>, results: Array<{ __typename: 'ProductVariantBulkResult', errors: Array<{ __typename: 'ProductVariantBulkError', field: string | null, code: ProductVariantBulkErrorCode, message: string | null, attributes: Array | null, values: Array | null, warehouses: Array | null, channels: Array | null }> | null }> } | null }; + export type InitialProductFilterAttributesQueryVariables = Exact<{ [key: string]: never; }>; @@ -8764,7 +8982,7 @@ export type ProductDetailsQueryVariables = Exact<{ }>; -export type ProductDetailsQuery = { __typename: 'Query', product: { __typename: 'Product', name: string, slug: string, description: any | null, seoTitle: string | null, seoDescription: string | null, rating: number | null, isAvailable: boolean | null, id: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, category: { __typename: 'Category', id: string, name: string } | null, collections: Array<{ __typename: 'Collection', id: string, name: string }> | null, channelListings: Array<{ __typename: 'ProductChannelListing', isPublished: boolean, publicationDate: any | null, isAvailableForPurchase: boolean | null, availableForPurchase: any | null, visibleInListings: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, sku: string | null, name: string, trackInventory: boolean, quantityLimitPerCustomer: number | null, attributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null }, values: Array<{ __typename: 'AttributeValue', id: string, name: string | null }> }>, media: Array<{ __typename: 'ProductMedia', url: string }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, channelListings: Array<{ __typename: 'ProductVariantChannelListing', channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null }> | null, productType: { __typename: 'ProductType', id: string, name: string, hasVariants: boolean, variantAttributes: Array<{ __typename: 'Attribute', id: string, name: string | null, inputType: AttributeInputTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }> | null }, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, taxClass: { __typename: 'TaxClass', id: string, name: string } | null, attributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, slug: string | null, name: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null }; +export type ProductDetailsQuery = { __typename: 'Query', product: { __typename: 'Product', name: string, slug: string, description: any | null, seoTitle: string | null, seoDescription: string | null, rating: number | null, isAvailable: boolean | null, id: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, category: { __typename: 'Category', id: string, name: string } | null, collections: Array<{ __typename: 'Collection', id: string, name: string }> | null, channelListings: Array<{ __typename: 'ProductChannelListing', isPublished: boolean, publicationDate: any | null, isAvailableForPurchase: boolean | null, availableForPurchase: any | null, visibleInListings: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, sku: string | null, name: string, trackInventory: boolean, quantityLimitPerCustomer: number | null, attributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null }, values: Array<{ __typename: 'AttributeValue', id: string, name: string | null }> }>, media: Array<{ __typename: 'ProductMedia', url: string }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, channelListings: Array<{ __typename: 'ProductVariantChannelListing', id: string, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null }> | null, productType: { __typename: 'ProductType', id: string, name: string, hasVariants: boolean, variantAttributes: Array<{ __typename: 'Attribute', id: string, name: string | null, inputType: AttributeInputTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }> | null }, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, taxClass: { __typename: 'TaxClass', id: string, name: string } | null, attributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, slug: string | null, name: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null }; export type ProductTypeQueryVariables = Exact<{ id: Scalars['ID']; @@ -8786,7 +9004,7 @@ export type ProductVariantDetailsQueryVariables = Exact<{ }>; -export type ProductVariantDetailsQuery = { __typename: 'Query', productVariant: { __typename: 'ProductVariant', id: string, name: string, sku: string | null, trackInventory: boolean, quantityLimitPerCustomer: number | null, selectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, nonSelectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null, product: { __typename: 'Product', id: string, name: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, thumbnail: { __typename: 'Image', url: string } | null, channelListings: Array<{ __typename: 'ProductChannelListing', id: string, publicationDate: any | null, isPublished: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, name: string, sku: string | null, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null }> | null }, channelListings: Array<{ __typename: 'ProductVariantChannelListing', channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null }; +export type ProductVariantDetailsQuery = { __typename: 'Query', productVariant: { __typename: 'ProductVariant', id: string, name: string, sku: string | null, trackInventory: boolean, quantityLimitPerCustomer: number | null, selectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, nonSelectionAttributes: Array<{ __typename: 'SelectedAttribute', attribute: { __typename: 'Attribute', id: string, name: string | null, slug: string | null, inputType: AttributeInputTypeEnum | null, entityType: AttributeEntityTypeEnum | null, valueRequired: boolean, unit: MeasurementUnitsEnum | null, choices: { __typename: 'AttributeValueCountableConnection', pageInfo: { __typename: 'PageInfo', endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null }, edges: Array<{ __typename: 'AttributeValueCountableEdge', cursor: string, node: { __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null } }> } | null }, values: Array<{ __typename: 'AttributeValue', plainText: string | null, richText: any | null, id: string, name: string | null, slug: string | null, reference: string | null, boolean: boolean | null, date: any | null, dateTime: any | null, value: string | null, file: { __typename: 'File', url: string, contentType: string | null } | null }> }>, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null, product: { __typename: 'Product', id: string, name: string, defaultVariant: { __typename: 'ProductVariant', id: string } | null, media: Array<{ __typename: 'ProductMedia', id: string, alt: string, sortOrder: number | null, url: string, type: ProductMediaType, oembedData: any }> | null, thumbnail: { __typename: 'Image', url: string } | null, channelListings: Array<{ __typename: 'ProductChannelListing', id: string, publicationDate: any | null, isPublished: boolean, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string } }> | null, variants: Array<{ __typename: 'ProductVariant', id: string, name: string, sku: string | null, media: Array<{ __typename: 'ProductMedia', id: string, url: string, type: ProductMediaType, oembedData: any }> | null }> | null }, channelListings: Array<{ __typename: 'ProductVariantChannelListing', id: string, channel: { __typename: 'Channel', id: string, name: string, currencyCode: string }, price: { __typename: 'Money', amount: number, currency: string } | null, costPrice: { __typename: 'Money', amount: number, currency: string } | null, preorderThreshold: { __typename: 'PreorderThreshold', quantity: number | null, soldUnits: number } | null }> | null, stocks: Array<{ __typename: 'Stock', id: string, quantity: number, quantityAllocated: number, warehouse: { __typename: 'Warehouse', id: string, name: string } }> | null, preorder: { __typename: 'PreorderData', globalThreshold: number | null, globalSoldUnits: number, endDate: any | null } | null, weight: { __typename: 'Weight', unit: WeightUnitsEnum, value: number } | null, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null }; export type ProductVariantCreateDataQueryVariables = Exact<{ id: Scalars['ID']; @@ -9582,7 +9800,7 @@ export type UpdateMetadataMutationVariables = Exact<{ }>; -export type UpdateMetadataMutation = { __typename: 'Mutation', updateMetadata: { __typename: 'UpdateMetadata', errors: Array<{ __typename: 'MetadataError', code: MetadataErrorCode, field: string | null, message: string | null }>, item: { __typename: 'App', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Attribute', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Category', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Checkout', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'CheckoutLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Collection', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'DigitalContent', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Fulfillment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'GiftCard', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Invoice', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Menu', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'MenuItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Order', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'OrderLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Page', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'PageType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Payment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Product', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductVariant', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Sale', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethod', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethodType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingZone', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxClass', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxConfiguration', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TransactionItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'User', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Voucher', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Warehouse', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null, deleteMetadata: { __typename: 'DeleteMetadata', errors: Array<{ __typename: 'MetadataError', code: MetadataErrorCode, field: string | null, message: string | null }>, item: { __typename: 'App', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Attribute', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Category', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Checkout', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'CheckoutLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Collection', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'DigitalContent', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Fulfillment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'GiftCard', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Invoice', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Menu', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'MenuItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Order', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'OrderLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Page', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'PageType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Payment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Product', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductVariant', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Sale', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethod', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethodType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingZone', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxClass', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxConfiguration', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TransactionItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'User', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Voucher', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Warehouse', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null }; +export type UpdateMetadataMutation = { __typename: 'Mutation', updateMetadata: { __typename: 'UpdateMetadata', errors: Array<{ __typename: 'MetadataError', code: MetadataErrorCode, field: string | null, message: string | null }>, item: { __typename: 'Address', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'App', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Attribute', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Category', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Checkout', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'CheckoutLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Collection', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'DigitalContent', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Fulfillment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'GiftCard', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Invoice', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Menu', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'MenuItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Order', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'OrderLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Page', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'PageType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Payment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Product', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductVariant', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Sale', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethod', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethodType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingZone', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxClass', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxConfiguration', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TransactionItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'User', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Voucher', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Warehouse', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null, deleteMetadata: { __typename: 'DeleteMetadata', errors: Array<{ __typename: 'MetadataError', code: MetadataErrorCode, field: string | null, message: string | null }>, item: { __typename: 'Address', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'App', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Attribute', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Category', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Checkout', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'CheckoutLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Collection', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'DigitalContent', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Fulfillment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'GiftCard', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Invoice', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Menu', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'MenuItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Order', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'OrderLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Page', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'PageType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Payment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Product', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductVariant', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Sale', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethod', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethodType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingZone', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxClass', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxConfiguration', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TransactionItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'User', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Voucher', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Warehouse', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null }; export type UpdatePrivateMetadataMutationVariables = Exact<{ id: Scalars['ID']; @@ -9591,7 +9809,7 @@ export type UpdatePrivateMetadataMutationVariables = Exact<{ }>; -export type UpdatePrivateMetadataMutation = { __typename: 'Mutation', updatePrivateMetadata: { __typename: 'UpdatePrivateMetadata', errors: Array<{ __typename: 'MetadataError', code: MetadataErrorCode, field: string | null, message: string | null }>, item: { __typename: 'App', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Attribute', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Category', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Checkout', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'CheckoutLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Collection', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'DigitalContent', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Fulfillment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'GiftCard', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Invoice', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Menu', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'MenuItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Order', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'OrderLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Page', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'PageType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Payment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Product', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductVariant', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Sale', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethod', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethodType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingZone', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxClass', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxConfiguration', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TransactionItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'User', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Voucher', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Warehouse', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null, deletePrivateMetadata: { __typename: 'DeletePrivateMetadata', errors: Array<{ __typename: 'MetadataError', code: MetadataErrorCode, field: string | null, message: string | null }>, item: { __typename: 'App', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Attribute', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Category', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Checkout', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'CheckoutLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Collection', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'DigitalContent', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Fulfillment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'GiftCard', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Invoice', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Menu', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'MenuItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Order', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'OrderLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Page', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'PageType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Payment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Product', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductVariant', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Sale', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethod', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethodType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingZone', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxClass', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxConfiguration', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TransactionItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'User', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Voucher', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Warehouse', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null }; +export type UpdatePrivateMetadataMutation = { __typename: 'Mutation', updatePrivateMetadata: { __typename: 'UpdatePrivateMetadata', errors: Array<{ __typename: 'MetadataError', code: MetadataErrorCode, field: string | null, message: string | null }>, item: { __typename: 'Address', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'App', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Attribute', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Category', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Checkout', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'CheckoutLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Collection', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'DigitalContent', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Fulfillment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'GiftCard', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Invoice', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Menu', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'MenuItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Order', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'OrderLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Page', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'PageType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Payment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Product', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductVariant', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Sale', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethod', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethodType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingZone', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxClass', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxConfiguration', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TransactionItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'User', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Voucher', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Warehouse', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null, deletePrivateMetadata: { __typename: 'DeletePrivateMetadata', errors: Array<{ __typename: 'MetadataError', code: MetadataErrorCode, field: string | null, message: string | null }>, item: { __typename: 'Address', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'App', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Attribute', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Category', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Checkout', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'CheckoutLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Collection', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'DigitalContent', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Fulfillment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'GiftCard', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Invoice', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Menu', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'MenuItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Order', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'OrderLine', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Page', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'PageType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Payment', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Product', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ProductVariant', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Sale', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethod', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingMethodType', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'ShippingZone', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxClass', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TaxConfiguration', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'TransactionItem', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'User', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Voucher', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | { __typename: 'Warehouse', id: string, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }> } | null } | null }; export type WarehouseDeleteMutationVariables = Exact<{ id: Scalars['ID']; diff --git a/src/misc.ts b/src/misc.ts index 7a572bfcf..fd6da149f 100644 --- a/src/misc.ts +++ b/src/misc.ts @@ -277,7 +277,11 @@ export const getMutationErrors = < return [] as TErrors; } return Object.values(result.data).reduce( - (acc: TErrors[], mut: TData) => [...acc, ...(mut.errors || [])], + (acc: TErrors[], mut: TData) => [ + ...acc, + ...(mut.errors || []), + ...(mut?.results?.flatMap(res => res.errors) || []), + ], [] as TErrors[], ) as TErrors; }; diff --git a/src/products/components/ProductUpdatePage/ProductUpdatePage.stories.tsx b/src/products/components/ProductUpdatePage/ProductUpdatePage.stories.tsx index b9b3be5ab..0289fd625 100644 --- a/src/products/components/ProductUpdatePage/ProductUpdatePage.stories.tsx +++ b/src/products/components/ProductUpdatePage/ProductUpdatePage.stories.tsx @@ -2,7 +2,10 @@ import placeholderImage from "@assets/images/placeholder255x255.png"; import { channelsList } from "@dashboard/channels/fixtures"; import { collections } from "@dashboard/collections/fixtures"; import { fetchMoreProps, limits, limitsReached } from "@dashboard/fixtures"; -import { ProductErrorCode } from "@dashboard/graphql"; +import { + ProductErrorCode, + ProductVariantBulkErrorCode, +} from "@dashboard/graphql"; import Decorator from "@dashboard/storybook/Decorator"; import { taxClasses } from "@dashboard/taxes/fixtures"; import { warehouseList } from "@dashboard/warehouses/fixtures"; @@ -23,7 +26,7 @@ const props: ProductUpdatePageProps = { variantId: product.variants[0].id, type: "channel", channelIds: [channelsList[1].id], - error: ProductErrorCode.ALREADY_EXISTS, + error: ProductVariantBulkErrorCode.PRODUCT_NOT_ASSIGNED_TO_CHANNEL, }, ], productId: "123", @@ -154,18 +157,20 @@ storiesOf("Products / Product edit", module) .add("form errors", () => ( ).map(field => ({ + errors={( + [ + "attributes", + "category", + "chargeTaxes", + "collections", + "name", + "publicationDate", + "seoDescription", + "seoTitle", + "sku", + "stockQuantity", + ] as Array + ).map(field => ({ __typename: "ProductError", attributes: field === "attributes" ? [product.attributes[0].attribute.id] : null, diff --git a/src/products/components/ProductUpdatePage/ProductUpdatePage.tsx b/src/products/components/ProductUpdatePage/ProductUpdatePage.tsx index 1a6c61eeb..91488b755 100644 --- a/src/products/components/ProductUpdatePage/ProductUpdatePage.tsx +++ b/src/products/components/ProductUpdatePage/ProductUpdatePage.tsx @@ -309,10 +309,11 @@ export const ProductUpdatePage: React.FC = ({ const listings = data.channels.updateChannels.map( listing => { const channel = channels?.find(ac => ac.id === listing.channelId); + return { - id: listing.channelId, ...channel, ...listing, + id: listing.channelId, availableForPurchase: listing.availableForPurchaseDate, currency: channel.currencyCode, }; diff --git a/src/products/components/ProductVariants/datagrid/getVariantChannelsInputs.ts b/src/products/components/ProductVariants/datagrid/getVariantChannelsInputs.ts deleted file mode 100644 index c2418985b..000000000 --- a/src/products/components/ProductVariants/datagrid/getVariantChannelsInputs.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { - DatagridChange, - DatagridChangeOpts, -} from "@dashboard/components/Datagrid/useDatagridChange"; - -import { getColumnChannel, getColumnChannelAvailability } from "./columnData"; - -const byCurrentRowByIndex = (index: number, data: DatagridChangeOpts) => ( - change: DatagridChange, -) => { - const totalRemoved = data.removed.filter(r => r <= index).length; - return change.row === index + totalRemoved; -}; - -const byChannelColumn = (change: DatagridChange) => - getColumnChannel(change.column); - -const availabilityToChannelColumn = (change: DatagridChange) => { - const availabilityChannelId = getColumnChannelAvailability(change.column); - - if (availabilityChannelId) { - return { - data: { - value: change.data ? 0 : null, - }, - column: `channel:${availabilityChannelId}`, - }; - } - return change; -}; - -const byColumn = (prev: DatagridChange[], change: DatagridChange) => { - const index = prev.findIndex(p => p.column === change.column); - if (index > -1) { - prev[index] = change; - return prev; - } - - return prev.concat(change); -}; - -const dataGridChangeToFlatChannel = (change: DatagridChange) => ({ - channelId: getColumnChannel(change.column), - price: change.data.value, -}); - -const byNotNullPrice = ( - change: ReturnType, -) => change.price !== null; - -export function getVariantChannelsInputs( - data: DatagridChangeOpts, - index: number, -) { - return data.updates - .filter(byCurrentRowByIndex(index, data)) - .map(availabilityToChannelColumn) - .filter(byChannelColumn) - .reduce(byColumn, []) - .map(dataGridChangeToFlatChannel) - .filter(byNotNullPrice); -} diff --git a/src/products/components/ProductVariants/utils.tsx b/src/products/components/ProductVariants/utils.tsx index 222efe70f..e9a7c66df 100644 --- a/src/products/components/ProductVariants/utils.tsx +++ b/src/products/components/ProductVariants/utils.tsx @@ -9,17 +9,11 @@ import { import { emptyDropdownCellValue } from "@dashboard/components/Datagrid/DropdownCell"; import { numberCellEmptyValue } from "@dashboard/components/Datagrid/NumberCell"; import { AvailableColumn } from "@dashboard/components/Datagrid/types"; -import { - DatagridChange, - DatagridChangeOpts, -} from "@dashboard/components/Datagrid/useDatagridChange"; +import { DatagridChange } from "@dashboard/components/Datagrid/useDatagridChange"; import { Choice } from "@dashboard/components/SingleSelectField"; import { ProductDetailsVariantFragment, ProductFragment, - VariantDatagridChannelListingUpdateMutationVariables, - VariantDatagridStockUpdateMutationVariables, - VariantDatagridUpdateMutationVariables, WarehouseFragment, } from "@dashboard/graphql"; import { ProductVariantListError } from "@dashboard/products/views/ProductUpdate/handlers/errors"; @@ -32,117 +26,11 @@ import { getColumnAttribute, getColumnChannel, getColumnChannelAvailability, + getColumnName, getColumnStock, -} from "./datagrid/columnData"; -import { getVariantChannelsInputs } from "./datagrid/getVariantChannelsInputs"; +} from "../../utils/datagrid"; import messages from "./messages"; -export function getVariantInput(data: DatagridChangeOpts, index: number) { - const attributes = data.updates - .filter( - change => - getColumnAttribute(change.column) && - change.row === index + data.removed.filter(r => r <= index).length, - ) - .map(change => { - const attributeId = getColumnAttribute(change.column); - - return { - id: attributeId, - values: [change.data.value.value], - }; - }); - - const sku = data.updates.find( - change => - change.column === "sku" && - change.row === index + data.removed.filter(r => r <= index).length, - )?.data; - - const name = data.updates.find( - change => - change.column === "name" && - change.row === index + data.removed.filter(r => r <= index).length, - )?.data; - - return { - attributes, - sku, - name, - }; -} - -export function getVariantInputs( - variants: ProductFragment["variants"], - data: DatagridChangeOpts, -): VariantDatagridUpdateMutationVariables[] { - return variants - .map( - (variant, variantIndex): VariantDatagridUpdateMutationVariables => ({ - id: variant.id, - input: getVariantInput(data, variantIndex), - }), - ) - .filter( - variables => - variables.input.sku || - variables.input.name || - variables.input.attributes.length > 0, - ); -} - -export function getStockInputs(data: DatagridChangeOpts, index: number) { - const stockChanges = data.updates.filter(change => - getColumnStock(change.column), - ); - - const variantChanges = stockChanges - .filter( - change => - change.row === index + data.removed.filter(r => r <= index).length, - ) - .map(change => ({ - warehouse: getColumnStock(change.column), - quantity: change.data.value, - })); - - return { - stocks: variantChanges.filter( - change => change.quantity !== numberCellEmptyValue, - ), - removeStocks: variantChanges - .filter(change => change.quantity === numberCellEmptyValue) - .map(({ warehouse }) => warehouse), - }; -} - -export function getStocks( - variants: ProductFragment["variants"], - data: DatagridChangeOpts, -): VariantDatagridStockUpdateMutationVariables[] { - return variants - .map((variant, variantIndex) => ({ - id: variant.id, - ...getStockInputs(data, variantIndex), - })) - .filter( - variables => - variables.removeStocks.length > 0 || variables.stocks.length > 0, - ); -} - -export function getVariantChannels( - variants: ProductFragment["variants"], - data: DatagridChangeOpts, -): VariantDatagridChannelListingUpdateMutationVariables[] { - return variants - .map((variant, variantIndex) => ({ - id: variant.id, - input: getVariantChannelsInputs(data, variantIndex), - })) - .filter(({ input }) => input.length > 0); -} - function errorMatchesColumn( error: ProductVariantListError, columnId: string, @@ -162,7 +50,8 @@ function errorMatchesColumn( if (error.attributes?.length > 0) { return error.attributes.includes(getColumnAttribute(columnId)); } - return columnId === "sku"; + + return error?.field?.includes(getColumnName(columnId)) ?? false; } } @@ -265,8 +154,9 @@ export function getData({ }; } - const currency = channels.find(channel => channelId === channel.id) - ?.currency; + const currency = channels.find( + channel => channelId === channel.id, + )?.currency; const value = change?.value ?? listing?.price?.amount ?? 0; return moneyCell(value, currency); diff --git a/src/products/fixtures.ts b/src/products/fixtures.ts index 9d0fcc70d..2a1bee218 100644 --- a/src/products/fixtures.ts +++ b/src/products/fixtures.ts @@ -635,8 +635,7 @@ export const product: ( quantity: 272, quantityAllocated: 0, warehouse: { - id: - "V2FyZWhvdXNlOjI2NDNiNmIwLWExMTQtNGRiMC1hM2U4LTFkZGY3ZGM3NDVkMg==", + id: "V2FyZWhvdXNlOjI2NDNiNmIwLWExMTQtNGRiMC1hM2U4LTFkZGY3ZGM3NDVkMg==", name: "Europe for click and collect", __typename: "Warehouse", }, @@ -647,8 +646,7 @@ export const product: ( quantity: 272, quantityAllocated: 0, warehouse: { - id: - "V2FyZWhvdXNlOmFmZDA4YjY4LWQwYmMtNGQ1My1iNjJkLTg1YWMxOWI3MjliYg==", + id: "V2FyZWhvdXNlOmFmZDA4YjY4LWQwYmMtNGQ1My1iNjJkLTg1YWMxOWI3MjliYg==", name: "Europe", __typename: "Warehouse", }, @@ -659,8 +657,7 @@ export const product: ( quantity: 274, quantityAllocated: 2, warehouse: { - id: - "V2FyZWhvdXNlOjMxOTRjNjY5LTY1YjItNDBjYy04ZDI5LWI3M2Q0YTUwODBmMQ==", + id: "V2FyZWhvdXNlOjMxOTRjNjY5LTY1YjItNDBjYy04ZDI5LWI3M2Q0YTUwODBmMQ==", name: "Asia", __typename: "Warehouse", }, @@ -671,8 +668,7 @@ export const product: ( quantity: 272, quantityAllocated: 0, warehouse: { - id: - "V2FyZWhvdXNlOjI5YzBlYmYwLWVkNzktNDlmOS1hYmQ0LWQwNDBlOGNlZmI3Mg==", + id: "V2FyZWhvdXNlOjI5YzBlYmYwLWVkNzktNDlmOS1hYmQ0LWQwNDBlOGNlZmI3Mg==", name: "Oceania", __typename: "Warehouse", }, @@ -683,8 +679,7 @@ export const product: ( quantity: 272, quantityAllocated: 0, warehouse: { - id: - "V2FyZWhvdXNlOjRiNjc1ZmVlLTE3OWYtNGMwNS04YmJlLWE0ZDJjOTc0OWQzMA==", + id: "V2FyZWhvdXNlOjRiNjc1ZmVlLTE3OWYtNGMwNS04YmJlLWE0ZDJjOTc0OWQzMA==", name: "Africa", __typename: "Warehouse", }, @@ -695,8 +690,7 @@ export const product: ( quantity: 274, quantityAllocated: 2, warehouse: { - id: - "V2FyZWhvdXNlOmQwODA2MzM5LTVhNjAtNDAxNi1hNGUwLTRjNDYxNTZlY2IzMQ==", + id: "V2FyZWhvdXNlOmQwODA2MzM5LTVhNjAtNDAxNi1hNGUwLTRjNDYxNTZlY2IzMQ==", name: "Americas", __typename: "Warehouse", }, @@ -707,6 +701,7 @@ export const product: ( preorder: null, channelListings: [ { + id: "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNTM=", channel: { id: "Q2hhbm5lbDox", name: "Channel-USD", @@ -731,6 +726,7 @@ export const product: ( __typename: "ProductVariantChannelListing", }, { + id: "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNDM=", channel: { id: "Q2hhbm5lbDoy", name: "Channel-PLN", @@ -793,6 +789,7 @@ export const product: ( preorder: null, channelListings: [ { + id: "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNEM=", channel: { id: "Q2hhbm5lbDox", name: "Channel-USD", @@ -817,6 +814,7 @@ export const product: ( __typename: "ProductVariantChannelListing", }, { + id: "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoreNTM=", channel: { id: "Q2hhbm5lbDoy", name: "Channel-PLN", @@ -880,8 +878,7 @@ export const product: ( quantity: 418, quantityAllocated: 0, warehouse: { - id: - "V2FyZWhvdXNlOmFmZDA4YjY4LWQwYmMtNGQ1My1iNjJkLTg1YWMxOWI3MjliYg==", + id: "V2FyZWhvdXNlOmFmZDA4YjY4LWQwYmMtNGQ1My1iNjJkLTg1YWMxOWI3MjliYg==", name: "Europe", __typename: "Warehouse", }, @@ -892,8 +889,7 @@ export const product: ( quantity: 418, quantityAllocated: 0, warehouse: { - id: - "V2FyZWhvdXNlOjMxOTRjNjY5LTY1YjItNDBjYy04ZDI5LWI3M2Q0YTUwODBmMQ==", + id: "V2FyZWhvdXNlOjMxOTRjNjY5LTY1YjItNDBjYy04ZDI5LWI3M2Q0YTUwODBmMQ==", name: "Asia", __typename: "Warehouse", }, @@ -904,8 +900,7 @@ export const product: ( quantity: 418, quantityAllocated: 0, warehouse: { - id: - "V2FyZWhvdXNlOmQwODA2MzM5LTVhNjAtNDAxNi1hNGUwLTRjNDYxNTZlY2IzMQ==", + id: "V2FyZWhvdXNlOmQwODA2MzM5LTVhNjAtNDAxNi1hNGUwLTRjNDYxNTZlY2IzMQ==", name: "Americas", __typename: "Warehouse", }, @@ -916,8 +911,7 @@ export const product: ( quantity: 418, quantityAllocated: 0, warehouse: { - id: - "V2FyZWhvdXNlOjI5YzBlYmYwLWVkNzktNDlmOS1hYmQ0LWQwNDBlOGNlZmI3Mg==", + id: "V2FyZWhvdXNlOjI5YzBlYmYwLWVkNzktNDlmOS1hYmQ0LWQwNDBlOGNlZmI3Mg==", name: "Oceania", __typename: "Warehouse", }, @@ -928,8 +922,7 @@ export const product: ( quantity: 418, quantityAllocated: 0, warehouse: { - id: - "V2FyZWhvdXNlOjI2NDNiNmIwLWExMTQtNGRiMC1hM2U4LTFkZGY3ZGM3NDVkMg==", + id: "V2FyZWhvdXNlOjI2NDNiNmIwLWExMTQtNGRiMC1hM2U4LTFkZGY3ZGM3NDVkMg==", name: "Europe for click and collect", __typename: "Warehouse", }, @@ -940,8 +933,7 @@ export const product: ( quantity: 418, quantityAllocated: 0, warehouse: { - id: - "V2FyZWhvdXNlOjRiNjc1ZmVlLTE3OWYtNGMwNS04YmJlLWE0ZDJjOTc0OWQzMA==", + id: "V2FyZWhvdXNlOjRiNjc1ZmVlLTE3OWYtNGMwNS04YmJlLWE0ZDJjOTc0OWQzMA==", name: "Africa", __typename: "Warehouse", }, @@ -952,6 +944,7 @@ export const product: ( preorder: null, channelListings: [ { + id: "UHJvZHVjdFZhcmlhbnRDaSAD3w2FubmVsTGlzdGluZzoyNTM=", channel: { id: "Q2hhbm5lbDox", name: "Channel-USD", @@ -976,6 +969,7 @@ export const product: ( __typename: "ProductVariantChannelListing", }, { + id: "UHJvZHVjdFZhcmlhdwxDaGFubmVsTGlzdGluZzoyNTM=", channel: { id: "Q2hhbm5lbDoy", name: "Channel-PLN", @@ -3215,6 +3209,7 @@ export const variant = (placeholderImage: string): ProductVariantFragment => ({ __typename: "ProductVariant", channelListings: [ { + id: "UHJvZHVjdFZhcasdasdASDDaGFubmVsTGlzdGluZzoyNTM=", __typename: "ProductVariantChannelListing", channel: { __typename: "Channel", @@ -3239,6 +3234,7 @@ export const variant = (placeholderImage: string): ProductVariantFragment => ({ }, }, { + id: "UHJvZHVjdFZhcmlhbnRDaGGSAEdsWsTGlzdGluZzoyNTM=", __typename: "ProductVariantChannelListing", channel: { __typename: "Channel", @@ -3377,8 +3373,8 @@ export const variant = (placeholderImage: string): ProductVariantFragment => ({ __typename: "Product" as "Product", channelListings: [ { + id: "2", __typename: "ProductChannelListing", - id: "11", isPublished: false, publicationDate: null, channel: { @@ -3389,8 +3385,8 @@ export const variant = (placeholderImage: string): ProductVariantFragment => ({ }, }, { + id: "2", __typename: "ProductChannelListing", - id: "12", isPublished: true, publicationDate: "2022-01-21", channel: { @@ -3791,10 +3787,9 @@ export const variantProductImages = (placeholderImage: string) => export const variantSiblings = (placeholderImage: string) => variant(placeholderImage).product.variants; -export const productTypesList: Array> = [ +export const productTypesList: Array< + Pick +> = [ { hasVariants: true, id: "UHJvZHVjdFR5cGU6Nw==", diff --git a/src/products/mutations.ts b/src/products/mutations.ts index bdec7d35a..e9e344f0c 100644 --- a/src/products/mutations.ts +++ b/src/products/mutations.ts @@ -117,48 +117,6 @@ export const variantDeleteMutation = gql` } `; -export const variantDatagridUpdateMutation = gql` - mutation VariantDatagridUpdate($id: ID!, $input: ProductVariantInput!) { - productVariantUpdate(id: $id, input: $input) { - errors { - ...ProductErrorWithAttributes - } - } - } -`; - -export const variantDatagridStockUpdateMutation = gql` - mutation VariantDatagridStockUpdate( - $stocks: [StockInput!]! - $removeStocks: [ID!]! - $id: ID! - ) { - productVariantStocksDelete(warehouseIds: $removeStocks, variantId: $id) { - errors { - ...ProductVariantStocksDeleteError - } - } - productVariantStocksUpdate(stocks: $stocks, variantId: $id) { - errors { - ...BulkStockError - } - } - } -`; - -export const variantDatagridChannelListingUpdateMutation = gql` - mutation VariantDatagridChannelListingUpdate( - $id: ID! - $input: [ProductVariantChannelListingAddInput!]! - ) { - productVariantChannelListingUpdate(id: $id, input: $input) { - errors { - ...ProductChannelListingError - } - } - } -`; - export const variantUpdateMutation = gql` mutation VariantUpdate( $addStocks: [StockInput!]! @@ -458,3 +416,26 @@ export const ProductVariantPreorderDeactivateMutation = gql` } } `; + +export const ProductVariantBulkUpdateMutation = gql` + mutation ProductVariantBulkUpdate( + $product: ID! + $input: [ProductVariantBulkUpdateInput!]! + $errorPolicy: ErrorPolicyEnum + ) { + productVariantBulkUpdate( + errorPolicy: $errorPolicy + product: $product + variants: $input + ) { + errors { + ...ProductVariantBulkError + } + results { + errors { + ...ProductVariantBulkError + } + } + } + } +`; diff --git a/src/products/utils/datagrid.test.ts b/src/products/utils/datagrid.test.ts new file mode 100644 index 000000000..4fb8c63fc --- /dev/null +++ b/src/products/utils/datagrid.test.ts @@ -0,0 +1,63 @@ +import { isCurrentRow } from "./datagrid"; + +describe("isCurrentRow", () => { + test("should return true when variant index is equal to datagrid row index and no removed rows", () => { + // Arrange & Act + const datagridChangeRowIndex = 1; + const variantIndex = 1; + const datagridRemoveRowsIds = []; + + // Assert + expect( + isCurrentRow(datagridChangeRowIndex, variantIndex, datagridRemoveRowsIds), + ).toEqual(true); + }); + + test("should return true when variant index is equal to datagrid row index and removed rows contain higher rows ids", () => { + // Arrange & Act + const datagridChangeRowIndex = 1; + const variantIndex = 1; + const datagridRemoveRowsIds = [4, 5, 6]; + + // Assert + expect( + isCurrentRow(datagridChangeRowIndex, variantIndex, datagridRemoveRowsIds), + ).toEqual(true); + }); + + test("should return false when variant index is not equal to datagrid row index and removed rows contains prev row id", () => { + // Arrange & Act + const datagridChangeRowIndex = 2; + const variantIndex = 1; + const datagridRemoveRowsIds = [1]; + + // Assert + expect( + isCurrentRow(datagridChangeRowIndex, variantIndex, datagridRemoveRowsIds), + ).toEqual(true); + }); + + test("should return false when variant index is not equal to datagrid row index ", () => { + // Arrange & Act + const datagridChangeRowIndex = 1; + const variantIndex = 2; + const datagridRemoveRowsIds = []; + + // Assert + expect( + isCurrentRow(datagridChangeRowIndex, variantIndex, datagridRemoveRowsIds), + ).toEqual(false); + }); + + test("should return false when variant index is equal to datagrid row index and removed rows contains prev row id", () => { + // Arrange & Act + const datagridChangeRowIndex = 2; + const variantIndex = 2; + const datagridRemoveRowsIds = [1]; + + // Assert + expect( + isCurrentRow(datagridChangeRowIndex, variantIndex, datagridRemoveRowsIds), + ).toEqual(false); + }); +}); diff --git a/src/products/components/ProductVariants/datagrid/columnData.ts b/src/products/utils/datagrid.ts similarity index 59% rename from src/products/components/ProductVariants/datagrid/columnData.ts rename to src/products/utils/datagrid.ts index 9e2efc52b..05720abff 100644 --- a/src/products/components/ProductVariants/datagrid/columnData.ts +++ b/src/products/utils/datagrid.ts @@ -16,3 +16,17 @@ export const getColumnChannelAvailability = makeGetColumnData( /^availableInChannel:(.*)/, ); export const getColumnStock = makeGetColumnData(/^stock:(.*)/); + +export const getColumnName = (column: string) => { + const splited = column.split(":"); + return splited[0]; +}; + +export const isCurrentRow = ( + datagridChangeIndex: number, + variantIndex: number, + datagridRemovedRowsIds: number[], +) => + datagridChangeIndex === + variantIndex + + datagridRemovedRowsIds.filter(index => index <= variantIndex).length; diff --git a/src/products/views/ProductUpdate/handlers/data/attributes.test.ts b/src/products/views/ProductUpdate/handlers/data/attributes.test.ts new file mode 100644 index 000000000..8da15ec60 --- /dev/null +++ b/src/products/views/ProductUpdate/handlers/data/attributes.test.ts @@ -0,0 +1,50 @@ +import { DatagridChange } from "@dashboard/components/Datagrid/useDatagridChange"; + +import { getAttributeData } from "./attributes"; + +describe("getAttributeData", () => { + test("should filter and map data to attribute format", () => { + // Arrage + const changeData: DatagridChange[] = [ + { column: "attribute:1", row: 1, data: { value: { value: "test" } } }, + { column: "attribute:2", row: 1, data: { value: { value: "test2" } } }, + ]; + + // Act + const attributes = getAttributeData(changeData, 1, []); + + // Assert + expect(attributes).toEqual([ + { id: "1", values: ["test"] }, + { id: "2", values: ["test2"] }, + ]); + }); + + test("should return empty array when no changes for given row", () => { + // Arrage + const changeData: DatagridChange[] = [ + { column: "attribute:1", row: 1, data: { value: { value: "test" } } }, + { column: "attribute:2", row: 1, data: { value: { value: "test2" } } }, + ]; + + // Act + const attributes = getAttributeData(changeData, 2, []); + + // Assert + expect(attributes).toEqual([]); + }); + + test("should return empty array when no changes for attributes column", () => { + // Arrage + const changeData: DatagridChange[] = [ + { column: "channel:1", row: 1, data: { value: { value: "test" } } }, + { column: "channel:2", row: 1, data: { value: { value: "test2" } } }, + ]; + + // Act + const attributes = getAttributeData(changeData, 1, []); + + // Assert + expect(attributes).toEqual([]); + }); +}); diff --git a/src/products/views/ProductUpdate/handlers/data/attributes.ts b/src/products/views/ProductUpdate/handlers/data/attributes.ts new file mode 100644 index 000000000..c7d5b4083 --- /dev/null +++ b/src/products/views/ProductUpdate/handlers/data/attributes.ts @@ -0,0 +1,29 @@ +import { DatagridChange } from "@dashboard/components/Datagrid/useDatagridChange"; +import { + getColumnAttribute, + isCurrentRow, +} from "@dashboard/products/utils/datagrid"; + +export function getAttributeData( + data: DatagridChange[], + currentIndex: number, + removedIds: number[], +) { + return data + .filter(change => isCurrentRow(change.row, currentIndex, removedIds)) + .filter(byHavingAnyAttribute) + .map(toAttributeData); +} + +function byHavingAnyAttribute(change: DatagridChange): boolean { + return !!getColumnAttribute(change.column); +} + +function toAttributeData(change: DatagridChange) { + const attributeId = getColumnAttribute(change.column); + + return { + id: attributeId, + values: change.data.value.value ? [change.data.value.value] : [], + }; +} diff --git a/src/products/views/ProductUpdate/handlers/data/channel.test.ts b/src/products/views/ProductUpdate/handlers/data/channel.test.ts new file mode 100644 index 000000000..24b2d8e8a --- /dev/null +++ b/src/products/views/ProductUpdate/handlers/data/channel.test.ts @@ -0,0 +1,301 @@ +import { DatagridChangeOpts } from "@dashboard/components/Datagrid/useDatagridChange"; +import { ProductFragment } from "@dashboard/graphql"; + +import { + getUpdateVariantChannelInputs, + getVariantChannelsInputs, +} from "./channel"; + +const channelListings = [ + { + id: "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNjA=", + channel: { + id: "Q2hhbm5lbDox", + }, + }, + { + id: "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNjD=", + channel: { + id: "Q2hhbm5lbDot", + }, + }, +]; + +describe("getUpdateVariantChannelInputs", () => { + test("should handle updated channels", () => { + // Arrange + const changeData: DatagridChangeOpts = { + added: [], + removed: [], + updates: [ + { + column: "channel:Q2hhbm5lbDox", + row: 1, + data: { + kind: "money-cell", + value: 43343, + currency: "USD", + }, + }, + { + column: "channel:Q2hhbm5lbDot", + row: 1, + data: { + kind: "money-cell", + value: 123, + currency: "PLN", + }, + }, + ], + }; + + // Act + const channels = getUpdateVariantChannelInputs(changeData, 1, { + channelListings, + } as ProductFragment["variants"][number]); + + // Assert + expect(channels).toEqual({ + create: [], + remove: [], + update: [ + { + channelListing: "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNjA=", + price: 43343, + }, + { + channelListing: "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNjD=", + price: 123, + }, + ], + }); + }); + + test("should handle removed channels", () => { + // Arrange + const changeData: DatagridChangeOpts = { + added: [], + removed: [], + updates: [ + { + data: false, + column: "availableInChannel:Q2hhbm5lbDox", + row: 1, + }, + { + data: false, + column: "availableInChannel:Q2hhbm5lbDot", + row: 1, + }, + ], + }; + + // Act + const channels = getUpdateVariantChannelInputs(changeData, 1, { + channelListings, + } as ProductFragment["variants"][number]); + + // Assert + expect(channels).toEqual({ + create: [], + remove: [ + "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNjA=", + "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNjD=", + ], + update: [], + }); + }); + + test("should handle created channels", () => { + // Arrange + const changeData: DatagridChangeOpts = { + added: [], + removed: [], + updates: [ + { + data: true, + column: "availableInChannel:Q2hhbm5lbDod", + row: 1, + }, + { + data: { + kind: "money-cell", + value: 3434, + currency: "USD", + }, + column: "channel:Q2hhbm5lbDod", + row: 1, + }, + ], + }; + + // Act + const channels = getUpdateVariantChannelInputs(changeData, 1, { + channelListings, + } as ProductFragment["variants"][number]); + + // Assert + expect(channels).toEqual({ + create: [ + { + channelId: "Q2hhbm5lbDod", + price: 3434, + }, + ], + remove: [], + update: [], + }); + }); + + test("should return empty arrays when no changes for given row", () => { + // Arrange + const changeData: DatagridChangeOpts = { + added: [], + removed: [], + updates: [ + { + column: "channel:Q2hhbm5lbDox", + row: 11, + data: { + kind: "money-cell", + value: 43343, + currency: "USD", + }, + }, + ], + }; + + // Act + const channels = getUpdateVariantChannelInputs(changeData, 1, { + channelListings, + } as ProductFragment["variants"][number]); + + // Assert + expect(channels).toEqual({ + create: [], + remove: [], + update: [], + }); + }); + + test("should return empty arrays when no changes for given column", () => { + // Arrange + const changeData: DatagridChangeOpts = { + added: [], + removed: [], + updates: [ + { column: "attribute:1", row: 1, data: { value: { value: "test" } } }, + { column: "attribute:2", row: 1, data: { value: { value: "test2" } } }, + ], + }; + + // Act + const channels = getUpdateVariantChannelInputs(changeData, 1, { + channelListings, + } as ProductFragment["variants"][number]); + + // Assert + expect(channels).toEqual({ + create: [], + remove: [], + update: [], + }); + }); +}); + +describe("getVariantChannelsInputs", () => { + test("should filter and map change data to channel format", () => { + // Arrange + const changeData: DatagridChangeOpts = { + added: [], + removed: [], + updates: [ + { + column: "channel:Q2hhbm5lbDox", + row: 1, + data: { + kind: "money-cell", + value: 43343, + currency: "USD", + }, + }, + ], + }; + + // Act + const channels = getVariantChannelsInputs(changeData, 1); + + // Assert + + expect(channels).toEqual([ + { + channelId: "Q2hhbm5lbDox", + price: 43343, + }, + ]); + }); + + test("should filter out changes with null prices", () => { + // Arrange + const changeData: DatagridChangeOpts = { + added: [], + removed: [], + updates: [ + { + data: false, + column: "availableInChannel:Q2hhbm5lbDox", + row: 1, + }, + ], + }; + + // Act + const channels = getVariantChannelsInputs(changeData, 1); + + // Assert + expect(channels).toEqual([]); + }); + + test("should return empty arrays when no changes for given row", () => { + // Arrange + const changeData: DatagridChangeOpts = { + added: [], + removed: [], + updates: [ + { + column: "channel:Q2hhbm5lbDox", + row: 11, + data: { + kind: "money-cell", + value: 43343, + currency: "USD", + }, + }, + ], + }; + + // Act + const channels = getVariantChannelsInputs(changeData, 1); + + // Assert + expect(channels).toEqual([]); + }); + + test("should return empty arrays when no changes for given column", () => { + // Arrange + const changeData: DatagridChangeOpts = { + added: [], + removed: [], + updates: [ + { column: "attribute:1", row: 1, data: { value: { value: "test" } } }, + { column: "attribute:2", row: 1, data: { value: { value: "test2" } } }, + ], + }; + + // Act + const channels = getVariantChannelsInputs(changeData, 1); + + // Assert + expect(channels).toEqual([]); + }); +}); diff --git a/src/products/views/ProductUpdate/handlers/data/channel.ts b/src/products/views/ProductUpdate/handlers/data/channel.ts new file mode 100644 index 000000000..13bdb9f86 --- /dev/null +++ b/src/products/views/ProductUpdate/handlers/data/channel.ts @@ -0,0 +1,129 @@ +import { + DatagridChange, + DatagridChangeOpts, +} from "@dashboard/components/Datagrid/useDatagridChange"; +import { + ProductFragment, + ProductVariantChannelListingAddInput, + ProductVariantChannelListingUpdateInput, +} from "@dashboard/graphql"; +import { + getColumnChannel, + getColumnChannelAvailability, +} from "@dashboard/products/utils/datagrid"; + +export function getUpdateVariantChannelInputs( + data: DatagridChangeOpts, + index: number, + variant: ProductFragment["variants"][number], +): ProductVariantChannelListingUpdateInput { + return data.updates + .filter(byCurrentRowByIndex(index, data)) + .map(availabilityToChannelColumn) + .filter(byChannelColumn) + .reduce(byColumn, []) + .map(dataGridChangeToFlatChannel) + .reduce( + toUpdateChannelData(variant), + { + create: [], + remove: [], + update: [], + }, + ); +} + +export function getVariantChannelsInputs( + data: DatagridChangeOpts, + index: number, +): ProductVariantChannelListingAddInput[] { + return data.updates + .filter(byCurrentRowByIndex(index, data)) + .map(availabilityToChannelColumn) + .filter(byChannelColumn) + .reduce(byColumn, []) + .map(dataGridChangeToFlatChannel) + .filter(byNotNullPrice); +} + +function byCurrentRowByIndex(index: number, data: DatagridChangeOpts) { + return (change: DatagridChange) => { + const totalRemoved = data.removed.filter(r => r <= index).length; + return change.row === index + totalRemoved; + }; +} + +function byChannelColumn(change: DatagridChange) { + return getColumnChannel(change.column); +} + +function availabilityToChannelColumn(change: DatagridChange) { + const availabilityChannelId = getColumnChannelAvailability(change.column); + + if (availabilityChannelId) { + return { + data: { + value: change.data ? 0 : null, + }, + column: `channel:${availabilityChannelId}`, + }; + } + return change; +} + +function byColumn(prev: DatagridChange[], change: DatagridChange) { + const index = prev.findIndex(p => p.column === change.column); + + if (index > -1) { + prev[index] = change; + return prev; + } + + return prev.concat(change); +} + +function dataGridChangeToFlatChannel(change: DatagridChange) { + return { + channelId: getColumnChannel(change.column), + price: change.data.value, + }; +} + +function byNotNullPrice( + change: ReturnType, +) { + return change.price !== null; +} + +function toUpdateChannelData(variant: ProductFragment["variants"][number]) { + return ( + acc: ProductVariantChannelListingUpdateInput, + channel: ReturnType, + ) => { + const variantChannel = variant.channelListings.find( + c => c.channel.id === channel.channelId, + ); + + if (channel.price === null) { + if (variantChannel) { + acc.remove.push(variantChannel.id); + } + + return acc; + } + + if (variantChannel) { + acc.update.push({ + channelListing: variantChannel.id, + price: channel.price, + }); + } else { + acc.create.push({ + channelId: channel.channelId, + price: channel.price, + }); + } + + return acc; + }; +} diff --git a/src/products/views/ProductUpdate/handlers/data/name.test.ts b/src/products/views/ProductUpdate/handlers/data/name.test.ts new file mode 100644 index 000000000..c1bfa97b6 --- /dev/null +++ b/src/products/views/ProductUpdate/handlers/data/name.test.ts @@ -0,0 +1,45 @@ +import { DatagridChange } from "@dashboard/components/Datagrid/useDatagridChange"; + +import { getNameData } from "./name"; + +describe("getNameData", () => { + test("should return name data", () => { + // Arrange + const changeData: DatagridChange[] = [ + { column: "name", row: 1, data: "Joe" }, + { column: "attribute:2", row: 1, data: { value: { value: "test2" } } }, + ]; + + // Act + const name = getNameData(changeData, 1, []); + + // Assert + expect(name).toEqual("Joe"); + }); + + test("should return undefined when no changes for given row", () => { + // Arrange + const changeData: DatagridChange[] = [ + { column: "attribute:2", row: 1, data: { value: { value: "test2" } } }, + ]; + + // Act + const name = getNameData(changeData, 1, []); + + // Assert + expect(name).toEqual(undefined); + }); + + test("should return undefined when no name column for given row", () => { + // Arrange + const changeData: DatagridChange[] = [ + { column: "name", row: 2, data: "Joe" }, + ]; + + // Act + const name = getNameData(changeData, 1, []); + + // Assert + expect(name).toEqual(undefined); + }); +}); diff --git a/src/products/views/ProductUpdate/handlers/data/name.ts b/src/products/views/ProductUpdate/handlers/data/name.ts new file mode 100644 index 000000000..91b3dad06 --- /dev/null +++ b/src/products/views/ProductUpdate/handlers/data/name.ts @@ -0,0 +1,14 @@ +import { DatagridChange } from "@dashboard/components/Datagrid/useDatagridChange"; +import { isCurrentRow } from "@dashboard/products/utils/datagrid"; + +export function getNameData( + data: DatagridChange[], + currentIndex: number, + removedIds: number[], +): string | undefined { + return data.find( + change => + change.column === "name" && + isCurrentRow(change.row, currentIndex, removedIds), + )?.data; +} diff --git a/src/products/views/ProductUpdate/handlers/data/sku.test.ts b/src/products/views/ProductUpdate/handlers/data/sku.test.ts new file mode 100644 index 000000000..5c4973a57 --- /dev/null +++ b/src/products/views/ProductUpdate/handlers/data/sku.test.ts @@ -0,0 +1,45 @@ +import { DatagridChange } from "@dashboard/components/Datagrid/useDatagridChange"; + +import { getSkuData } from "./sku"; + +describe("getSkuData", () => { + test("should return name data", () => { + // Arrange + const changeData: DatagridChange[] = [ + { column: "sku", row: 1, data: "123" }, + { column: "attribute:2", row: 1, data: { value: { value: "test2" } } }, + ]; + + // Act + const name = getSkuData(changeData, 1, []); + + // Assert + expect(name).toEqual("123"); + }); + + test("should return undefined when no changes for given row", () => { + // Arrange + const changeData: DatagridChange[] = [ + { column: "attribute:2", row: 1, data: { value: { value: "test2" } } }, + ]; + + // Act + const name = getSkuData(changeData, 1, []); + + // Assert + expect(name).toEqual(undefined); + }); + + test("should return undefined when no name column for given row", () => { + // Arrange + const changeData: DatagridChange[] = [ + { column: "sku", row: 2, data: "Joe" }, + ]; + + // Act + const name = getSkuData(changeData, 1, []); + + // Assert + expect(name).toEqual(undefined); + }); +}); diff --git a/src/products/views/ProductUpdate/handlers/data/sku.ts b/src/products/views/ProductUpdate/handlers/data/sku.ts new file mode 100644 index 000000000..2aa9d9fbf --- /dev/null +++ b/src/products/views/ProductUpdate/handlers/data/sku.ts @@ -0,0 +1,14 @@ +import { DatagridChange } from "@dashboard/components/Datagrid/useDatagridChange"; +import { isCurrentRow } from "@dashboard/products/utils/datagrid"; + +export function getSkuData( + data: DatagridChange[], + currentIndex: number, + removedIds: number[], +): string | undefined { + return data.find( + change => + change.column === "sku" && + isCurrentRow(change.row, currentIndex, removedIds), + )?.data; +} diff --git a/src/products/views/ProductUpdate/handlers/data/stock.ts b/src/products/views/ProductUpdate/handlers/data/stock.ts new file mode 100644 index 000000000..bc406b4c6 --- /dev/null +++ b/src/products/views/ProductUpdate/handlers/data/stock.ts @@ -0,0 +1,88 @@ +import { numberCellEmptyValue } from "@dashboard/components/Datagrid/NumberCell"; +import { DatagridChange } from "@dashboard/components/Datagrid/useDatagridChange"; +import { + ProductFragment, + ProductVariantStocksUpdateInput, +} from "@dashboard/graphql"; +import { + getColumnStock, + isCurrentRow, +} from "@dashboard/products/utils/datagrid"; + +export function getStockData( + data: DatagridChange[], + currentIndex: number, + removedIds: number[], +) { + return data + .filter(change => byHavingStockColumn(change, currentIndex, removedIds)) + .map(toStockData) + .filter(byStockWithQuantity); +} + +export function getVaraintUpdateStockData( + data: DatagridChange[], + currentIndex: number, + removedIds: number[], + variant: ProductFragment["variants"][number], +) { + return data + .filter(change => byHavingStockColumn(change, currentIndex, removedIds)) + .map(toStockData) + .reduce(toUpdateStockData(variant), { + create: [], + update: [], + remove: [], + }); +} + +function toUpdateStockData(variant: ProductFragment["variants"][number]) { + return ( + acc: ProductVariantStocksUpdateInput, + stock: ReturnType, + ) => { + const variantStock = variant.stocks.find( + variantStock => variantStock.warehouse.id === stock.warehouse, + ); + + if (stock.quantity === numberCellEmptyValue) { + if (variantStock) { + acc.remove.push(variantStock.id); + } + return acc; + } + + if (variantStock) { + acc.update.push({ + quantity: stock.quantity as number, + stock: variantStock.id, + }); + } else { + acc.create.push(stock); + } + + return acc; + }; +} + +function toStockData(change: DatagridChange) { + return { + warehouse: getColumnStock(change.column), + quantity: change.data.value, + }; +} + +function byStockWithQuantity(stock: { quantity: unknown }) { + return stock.quantity !== numberCellEmptyValue; +} + +function byHavingStockColumn( + change: DatagridChange, + currentIndex: number, + removedIds: number[], +) { + return ( + getColumnStock(change.column) && + isCurrentRow(change.row, currentIndex, removedIds) + ); +} diff --git a/src/products/views/ProductUpdate/handlers/data/stocks.test.ts b/src/products/views/ProductUpdate/handlers/data/stocks.test.ts new file mode 100644 index 000000000..e42913aa4 --- /dev/null +++ b/src/products/views/ProductUpdate/handlers/data/stocks.test.ts @@ -0,0 +1,198 @@ +import { numberCellEmptyValue } from "@dashboard/components/Datagrid/NumberCell"; +import { DatagridChange } from "@dashboard/components/Datagrid/useDatagridChange"; +import { ProductFragment } from "@dashboard/graphql"; + +import { getStockData, getVaraintUpdateStockData } from "./stock"; + +describe("getStockData", () => { + test("should filter and map to stock format", () => { + // Arrange + const changeData: DatagridChange[] = [ + { + data: false, + column: "availableInChannel:Q2hhbm5lbDox", + row: 1, + }, + { column: "attribute:2", row: 2, data: { value: { value: "test2" } } }, + { column: "stock:Q2hhbm5lbDox", row: 1, data: { value: "12345" } }, + { column: "stock:Q2hhbm5lbDot", row: 1, data: { value: "5666" } }, + ]; + + // Act + const stocks = getStockData(changeData, 1, []); + + // Assert + expect(stocks).toEqual([ + { + warehouse: "Q2hhbm5lbDox", + quantity: "12345", + }, + { + warehouse: "Q2hhbm5lbDot", + quantity: "5666", + }, + ]); + }); + + test("should return empty array when no changes for given row", () => { + // Arrange + const changeData: DatagridChange[] = [ + { column: "attribute:2", row: 1, data: { value: { value: "test2" } } }, + ]; + + // Act + const stocks = getStockData(changeData, 1, []); + + // Assert + expect(stocks).toEqual([]); + }); + + test("should return empty string when no name column for given row", () => { + // Arrange + const changeData: DatagridChange[] = [ + { column: "name", row: 2, data: "Joe" }, + ]; + + // Act + const stocks = getStockData(changeData, 1, []); + + // Assert + expect(stocks).toEqual([]); + }); +}); + +describe("getVaraintUpdateStockData", () => { + const stocks = [ + { + id: "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNjA=", + warehouse: { + id: "Q2hhbm5lbDox", + }, + }, + { + id: "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNjD=", + warehouse: { + id: "Q2hhbm5lbDot", + }, + }, + ]; + + test("should handle update stocks", () => { + // Arrange + const changeData: DatagridChange[] = [ + { column: "stock:Q2hhbm5lbDox", row: 1, data: { value: "12345" } }, + { column: "stock:Q2hhbm5lbDot", row: 1, data: { value: "5666" } }, + ]; + + // Act + const variantStocks = getVaraintUpdateStockData(changeData, 1, [], { + stocks, + } as ProductFragment["variants"][number]); + + // Assert + expect(variantStocks).toEqual({ + create: [], + remove: [], + update: [ + { + stock: "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNjA=", + quantity: "12345", + }, + { + stock: "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNjD=", + quantity: "5666", + }, + ], + }); + }); + + test("should handle remove stocks", () => { + // Arrange + const changeData: DatagridChange[] = [ + { + column: "stock:Q2hhbm5lbDox", + row: 1, + data: { value: numberCellEmptyValue }, + }, + { + column: "stock:Q2hhbm5lbDot", + row: 1, + data: { value: numberCellEmptyValue }, + }, + ]; + + // Act + const variantStocks = getVaraintUpdateStockData(changeData, 1, [], { + stocks, + } as ProductFragment["variants"][number]); + + // Assert + expect(variantStocks).toEqual({ + create: [], + remove: [ + "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNjA=", + "UHJvZHVjdFZhcmlhbnRDaGFubmVsTGlzdGluZzoyNjD=", + ], + update: [], + }); + }); + + test("should handle create stocks", () => { + // Arrange + const changeData: DatagridChange[] = [ + { column: "stock:Q2hhbm5lbDof", row: 1, data: { value: "12345" } }, + { column: "stock:Q2hhbm5lbDod", row: 1, data: { value: "5666" } }, + ]; + + // Act + const variantStocks = getVaraintUpdateStockData(changeData, 1, [], { + stocks, + } as ProductFragment["variants"][number]); + + // Assert + expect(variantStocks).toEqual({ + create: [ + { + warehouse: "Q2hhbm5lbDof", + quantity: "12345", + }, + { + warehouse: "Q2hhbm5lbDod", + quantity: "5666", + }, + ], + remove: [], + update: [], + }); + }); + + test("should return empty array when no changes for given row", () => { + // Arrange + const changeData: DatagridChange[] = [ + { column: "attribute:2", row: 1, data: { value: { value: "test2" } } }, + ]; + + // Act + const variantStocks = getVaraintUpdateStockData(changeData, 1, [], { + stocks, + } as ProductFragment["variants"][number]); + + // Assert + expect(variantStocks).toEqual({ create: [], remove: [], update: [] }); + }); + + test("should return empty string when no name column for given row", () => { + // Arrange + const changeData: DatagridChange[] = [ + { column: "name", row: 2, data: "Joe" }, + ]; + + // Act + const variantStocks = getVaraintUpdateStockData(changeData, 1, [], { + stocks, + } as ProductFragment["variants"][number]); + + // Assert + expect(variantStocks).toEqual({ create: [], remove: [], update: [] }); + }); +}); diff --git a/src/products/views/ProductUpdate/handlers/errors.ts b/src/products/views/ProductUpdate/handlers/errors.ts index f5377981a..ac8d7786e 100644 --- a/src/products/views/ProductUpdate/handlers/errors.ts +++ b/src/products/views/ProductUpdate/handlers/errors.ts @@ -1,24 +1,19 @@ import { FetchResult } from "@apollo/client"; import { - ProductChannelListingUpdateMutation, ProductErrorCode, ProductVariantBulkCreateMutation, - ProductVariantChannelListingUpdateMutation, - ProductVariantChannelListingUpdateMutationVariables, - StockInput, - VariantDatagridStockUpdateMutation, - VariantDatagridStockUpdateMutationVariables, - VariantDatagridUpdateMutation, - VariantDatagridUpdateMutationVariables, + ProductVariantBulkErrorCode, + ProductVariantBulkErrorFragment, + ProductVariantBulkUpdateMutation, } from "@dashboard/graphql"; -import { hasMutationErrors } from "@dashboard/misc"; export type ProductVariantListError = | { __typename: "DatagridError"; attributes: string[] | null; - error: ProductErrorCode; + error: ProductVariantBulkErrorCode; variantId: string; + field?: string; type: "variantData"; } | { @@ -29,7 +24,7 @@ export type ProductVariantListError = } | { __typename: "DatagridError"; - error: ProductErrorCode; + error: ProductVariantBulkErrorCode; variantId: string; channelIds: string[]; type: "channel"; @@ -41,80 +36,101 @@ export type ProductVariantListError = type: "create"; }; -export function getProductVariantListErrors( - productChannelsUpdateResult: FetchResult, - variantMutationResults: FetchResult[], +export function getCreateVariantMutationError( + result: FetchResult, ): ProductVariantListError[] { - return [productChannelsUpdateResult, ...variantMutationResults] - .filter(hasMutationErrors) - .flatMap(result => { - if (result.data.productVariantChannelListingUpdate) { - const data = result.data as ProductVariantChannelListingUpdateMutation; - return data.productVariantChannelListingUpdate.errors.map< - ProductVariantListError - >(error => ({ - __typename: "DatagridError", - type: "channel", - error: error.code, - variantId: (result.extensions - .variables as ProductVariantChannelListingUpdateMutationVariables) - .id, - channelIds: error.channels, - })); - } - - if (result.data.productVariantStocksUpdate) { - const data = result.data as VariantDatagridStockUpdateMutation; - const variables = result.extensions - .variables as VariantDatagridStockUpdateMutationVariables; - return [ - ...data.productVariantStocksUpdate.errors.map< - ProductVariantListError - >(error => ({ - __typename: "DatagridError", - type: "stock", - variantId: (variables as VariantDatagridStockUpdateMutationVariables) - .id, - warehouseId: (variables.stocks as StockInput[])[error.index] - .warehouse, - })), - ...data.productVariantStocksDelete.errors.map< - ProductVariantListError - >(() => ({ - __typename: "DatagridError", - type: "stock", - variantId: (variables as VariantDatagridStockUpdateMutationVariables) - .id, - warehouseId: null, - })), - ]; - } - - if (result.data.productVariantUpdate) { - const data = result.data as VariantDatagridUpdateMutation; - const variables = result.extensions - .variables as VariantDatagridUpdateMutationVariables; - return data.productVariantUpdate.errors.map( - error => ({ - __typename: "DatagridError", - type: "variantData", - variantId: (variables as VariantDatagridUpdateMutationVariables).id, - error: error.code, - attributes: error.attributes, - }), - ); - } - - if (result.data.productVariantBulkCreate) { - const data = result.data as ProductVariantBulkCreateMutation; - return data.productVariantBulkCreate.errors.map< - ProductVariantListError - >(error => ({ - __typename: "DatagridError", - type: "create", - index: error.index, - error: error.code, - })); - } - }); + return result.data.productVariantBulkCreate.errors.map( + error => ({ + __typename: "DatagridError", + type: "create", + index: error.index, + error: error.code, + }), + ); +} + +export function getVariantUpdateMutationErrors( + mutationResult: FetchResult, + varaintsIds: string[], +): ProductVariantListError[] { + const { productVariantBulkUpdate } = mutationResult.data; + const generalErrors = productVariantBulkUpdate.errors; + const variantsErrors = productVariantBulkUpdate.results.flatMap( + res => res.errors, + ); + const allErrors = [...generalErrors, ...variantsErrors]; + + return [ + ...getChannelErrors(allErrors, varaintsIds), + ...getStockErrors(allErrors, varaintsIds), + ...getRestOfErrors(allErrors, varaintsIds), + ]; +} + +function getChannelErrors( + errors: ProductVariantBulkErrorFragment[], + varaintsIds: string[], +) { + return errors.reduce((acc, error, index) => { + if (error.channels?.length) { + const variantId = varaintsIds[index]; + + acc.push({ + __typename: "DatagridError", + type: "channel", + error: error.code, + variantId, + channelIds: error.channels, + }); + } + + return acc; + }, []); +} + +function getStockErrors( + errors: ProductVariantBulkErrorFragment[], + varaintsIds: string[], +) { + return errors.reduce((acc, error, index) => { + if (error.warehouses?.length) { + const variantId = varaintsIds[index]; + + acc.push( + ...error.warehouses.map( + warehouse => + ({ + __typename: "DatagridError", + variantId, + warehouseId: warehouse, + type: "stock", + } as const), + ), + ); + } + + return acc; + }, []); +} + +function getRestOfErrors( + errors: ProductVariantBulkErrorFragment[], + varaintsIds: string[], +) { + return errors.reduce((acc, error, index) => { + if (!error.warehouses?.length && !error.channels?.length) { + const variantId = varaintsIds[index]; + + acc.push({ + __typename: "DatagridError", + type: "variantData", + variantId, + error: error.code, + attributes: error.attributes, + field: error.field, + }); + } + + return acc; + }, []); } diff --git a/src/products/views/ProductUpdate/handlers/useProductUpdateHandler.ts b/src/products/views/ProductUpdate/handlers/useProductUpdateHandler.ts index f8a833185..188f4a8d7 100644 --- a/src/products/views/ProductUpdate/handlers/useProductUpdateHandler.ts +++ b/src/products/views/ProductUpdate/handlers/useProductUpdateHandler.ts @@ -1,4 +1,3 @@ -import { FetchResult } from "@apollo/client"; import { mergeAttributeValueDeleteErrors, mergeFileUploadErrors, @@ -9,7 +8,7 @@ import { } from "@dashboard/attributes/utils/handlers"; import { AttributeErrorFragment, - BulkProductErrorFragment, + ErrorPolicyEnum, MetadataErrorFragment, ProductChannelListingErrorFragment, ProductErrorFragment, @@ -22,38 +21,34 @@ import { useProductUpdateMutation, useProductVariantBulkCreateMutation, useProductVariantBulkDeleteMutation, + useProductVariantBulkUpdateMutation, useUpdateMetadataMutation, useUpdatePrivateMetadataMutation, - useVariantDatagridChannelListingUpdateMutation, - useVariantDatagridStockUpdateMutation, - useVariantDatagridUpdateMutation, } from "@dashboard/graphql"; import useNotifier from "@dashboard/hooks/useNotifier"; import { commonMessages } from "@dashboard/intl"; import { ProductUpdateSubmitData } from "@dashboard/products/components/ProductUpdatePage/types"; -import { getVariantChannelsInputs } from "@dashboard/products/components/ProductVariants/datagrid/getVariantChannelsInputs"; -import { - getStockInputs, - getStocks, - getVariantChannels, - getVariantInput, - getVariantInputs, -} from "@dashboard/products/components/ProductVariants/utils"; import { getProductErrorMessage } from "@dashboard/utils/errors"; import createMetadataUpdateHandler from "@dashboard/utils/handlers/metadataUpdateHandler"; import { useState } from "react"; import { useIntl } from "react-intl"; -import { getProductVariantListErrors, ProductVariantListError } from "./errors"; import { + getCreateVariantMutationError, + getVariantUpdateMutationErrors, + ProductVariantListError, +} from "./errors"; +import { + getBulkVariantUpdateInputs, + getCreateVariantInput, getProductChannelsUpdateVariables, getProductUpdateVariables, + hasProductChannelsUpdate, } from "./utils"; export type UseProductUpdateHandlerError = | ProductErrorWithAttributesFragment | ProductErrorFragment - | BulkProductErrorFragment | AttributeErrorFragment | UploadErrorFragment | ProductChannelListingErrorFragment @@ -62,6 +57,7 @@ export type UseProductUpdateHandlerError = type UseProductUpdateHandler = ( data: ProductUpdateSubmitData, ) => Promise>; + interface UseProductUpdateHandlerOpts { called: boolean; loading: boolean; @@ -83,33 +79,26 @@ export function useProductUpdateHandler( const [updateMetadata] = useUpdateMetadataMutation({}); const [updatePrivateMetadata] = useUpdatePrivateMetadataMutation({}); - const [updateStocks] = useVariantDatagridStockUpdateMutation({}); - const [updateVariant] = useVariantDatagridUpdateMutation(); + const [updateVariants] = useProductVariantBulkUpdateMutation(); const [createVariants] = useProductVariantBulkCreateMutation(); const [deleteVariants] = useProductVariantBulkDeleteMutation(); const [uploadFile] = useFileUploadMutation(); const [updateProduct, updateProductOpts] = useProductUpdateMutation(); - const [ - updateChannels, - updateChannelsOpts, - ] = useProductChannelListingUpdateMutation({ - onCompleted: data => { - if (!!data.productChannelListingUpdate.errors.length) { - data.productChannelListingUpdate.errors.forEach(error => - notify({ - status: "error", - text: getProductErrorMessage(error, intl), - }), - ); - } - }, - }); - - const [ - updateVariantChannels, - ] = useVariantDatagridChannelListingUpdateMutation(); + const [updateChannels, updateChannelsOpts] = + useProductChannelListingUpdateMutation({ + onCompleted: data => { + if (!!data.productChannelListingUpdate.errors.length) { + data.productChannelListingUpdate.errors.forEach(error => + notify({ + status: "error", + text: getProductErrorMessage(error, intl), + }), + ); + } + }, + }); const [deleteAttributeValue] = useAttributeValueDeleteMutation(); @@ -117,84 +106,103 @@ export function useProductUpdateHandler( data: ProductUpdateSubmitData, ): Promise => { let errors: UseProductUpdateHandlerError[] = []; + const variantErrors: ProductVariantListError[] = []; + const uploadFilesResult = await handleUploadMultipleFiles( data.attributesWithNewFileValue, variables => uploadFile({ variables }), ); - const deleteAttributeValuesResult = await handleDeleteMultipleAttributeValues( - data.attributesWithNewFileValue, - product?.attributes, - variables => deleteAttributeValue({ variables }), + const deleteAttributeValuesResult = + await handleDeleteMultipleAttributeValues( + data.attributesWithNewFileValue, + product?.attributes, + variables => deleteAttributeValue({ variables }), + ); + + const updateProductChannelsData = getProductChannelsUpdateVariables( + product, + data, ); + if (hasProductChannelsUpdate(updateProductChannelsData.input)) { + const updateChannelsResult = await updateChannels({ + variables: updateProductChannelsData, + }); + + errors = [ + ...errors, + ...updateChannelsResult.data.productChannelListingUpdate.errors, + ]; + } + + if (data.variants.removed.length > 0) { + const deleteVaraintsResult = await deleteVariants({ + variables: { + ids: data.variants.removed.map(index => product.variants[index].id), + }, + }); + + errors = [ + ...errors, + ...deleteVaraintsResult.data.productVariantBulkDelete.errors, + ]; + } + + const updateProductResult = await updateProduct({ + variables: getProductUpdateVariables(product, data, uploadFilesResult), + }); + + if (data.variants.added.length > 0) { + const createVariantsResults = await createVariants({ + variables: { + id: product.id, + inputs: data.variants.added.map(index => ({ + ...getCreateVariantInput(data.variants, index), + })), + }, + }); + + const createVariantsErrors = getCreateVariantMutationError( + createVariantsResults, + ); + + errors.push(...createVariantsErrors); + variantErrors.push(...createVariantsErrors); + } + + if (data.variants.updates.length > 0) { + const updateInputdData = getBulkVariantUpdateInputs( + product.variants, + data.variants, + ); + + if (updateInputdData.length) { + const updateVariantsResults = await updateVariants({ + variables: { + product: product.id, + input: updateInputdData, + errorPolicy: ErrorPolicyEnum.REJECT_FAILED_ROWS, + }, + }); + + const updateVariantsErrors = getVariantUpdateMutationErrors( + updateVariantsResults, + updateInputdData.map(data => data.id), + ); + + variantErrors.push(...updateVariantsErrors); + errors.push(...updateVariantsErrors); + } + } + errors = [ ...errors, ...mergeFileUploadErrors(uploadFilesResult), ...mergeAttributeValueDeleteErrors(deleteAttributeValuesResult), + ...updateProductResult.data.productUpdate.errors, ]; - if (data.variants.removed.length > 0) { - errors.push( - ...( - await deleteVariants({ - variables: { - ids: data.variants.removed.map( - index => product.variants[index].id, - ), - }, - }) - ).data.productVariantBulkDelete.errors, - ); - } - - const result = await updateProduct({ - variables: getProductUpdateVariables(product, data, uploadFilesResult), - }); - errors = [...errors, ...result.data.productUpdate.errors]; - - const productChannelsUpdateResult = await updateChannels({ - variables: getProductChannelsUpdateVariables(product, data), - }); - - const mutations: Array> = [ - ...getStocks(product.variants, data.variants).map(variables => - updateStocks({ variables }), - ), - ...getVariantInputs(product.variants, data.variants).map(variables => - updateVariant({ variables }), - ), - ...getVariantChannels(product.variants, data.variants).map(variables => - updateVariantChannels({ - variables, - }), - ), - ]; - - if (data.variants.added.length > 0) { - mutations.push( - createVariants({ - variables: { - id: product.id, - inputs: data.variants.added.map(index => ({ - ...getVariantInput(data.variants, index), - channelListings: getVariantChannelsInputs(data.variants, index), - stocks: getStockInputs(data.variants, index).stocks, - })), - }, - }), - ); - } - - const variantMutationResults = await Promise.all(mutations); - - const variantErrors = getProductVariantListErrors( - productChannelsUpdateResult, - variantMutationResults, - ); - - errors = [...errors, ...variantErrors]; - setVariantListErrors(variantErrors); return errors; diff --git a/src/products/views/ProductUpdate/handlers/utils.test.ts b/src/products/views/ProductUpdate/handlers/utils.test.ts index 945cc6946..e0f389bc7 100644 --- a/src/products/views/ProductUpdate/handlers/utils.test.ts +++ b/src/products/views/ProductUpdate/handlers/utils.test.ts @@ -1,7 +1,13 @@ +import { DatagridChangeOpts } from "@dashboard/components/Datagrid/useDatagridChange"; import { ProductFragment } from "@dashboard/graphql"; import { ProductUpdateSubmitData } from "@dashboard/products/components/ProductUpdatePage/types"; -import { inferProductChannelsAfterUpdate } from "./utils"; +import { product } from "../../../fixtures"; +import { + getBulkVariantUpdateInputs, + getCreateVariantInput, + inferProductChannelsAfterUpdate, +} from "./utils"; describe("Product update utils", () => { it("should infer product channels after update with data", () => { @@ -74,3 +80,268 @@ describe("Product update utils", () => { expect(result).toEqual(["1", "2", "3"]); }); }); + +describe("getCreateVariantInput", () => { + test("should return input data base on datagrid change data", () => { + // Arrange + const inputData: DatagridChangeOpts = { + updates: [ + { + data: "new item", + column: "name", + row: 1, + }, + { + data: "23423", + column: "sku", + row: 1, + }, + { + data: true, + column: "availableInChannel:Q2hhbm5lbDoyMjQz", + row: 1, + }, + { + data: { + kind: "money-cell", + value: 33434, + currency: "USD", + }, + column: "channel:Q2hhbm5lbDoyMjQz", + row: 1, + }, + { + data: true, + column: "availableInChannel:Q2hhbm5lbDoyNTQy", + row: 1, + }, + { + data: { + kind: "money-cell", + value: 434, + currency: "BHD", + }, + column: "channel:Q2hhbm5lbDoyNTQy", + row: 1, + }, + { + data: { + kind: "number-cell", + value: 3223, + }, + column: + "stock:V2FyZWhvdXNlOmQ0YzI0ODQxLTg2MDgtNGFiNC04MDkzLWUxNmQ4NWNlYjdkYQ==", + row: 1, + }, + { + data: { + allowCustomValues: true, + emptyOption: true, + kind: "dropdown-cell", + value: { + label: "1l", + value: "1l", + }, + }, + column: "attribute:QXR0cmlidXRlOjE1", + row: 1, + }, + ], + removed: [], + added: [1], + }; + // Act + const createDataInput = getCreateVariantInput(inputData, 1); + + // Assert + expect(createDataInput).toEqual({ + attributes: [ + { + id: "QXR0cmlidXRlOjE1", + values: ["1l"], + }, + ], + sku: "23423", + name: "new item", + channelListings: [ + { + channelId: "Q2hhbm5lbDoyMjQz", + price: 33434, + }, + { + channelId: "Q2hhbm5lbDoyNTQy", + price: 434, + }, + ], + stocks: [ + { + warehouse: + "V2FyZWhvdXNlOmQ0YzI0ODQxLTg2MDgtNGFiNC04MDkzLWUxNmQ4NWNlYjdkYQ==", + quantity: 3223, + }, + ], + }); + }); + + test("should return only sku and name", () => { + // Arrange + const inputData: DatagridChangeOpts = { + updates: [ + { + data: "new item", + column: "name", + row: 1, + }, + { + data: "23423", + column: "sku", + row: 1, + }, + ], + removed: [], + added: [1], + }; + + // Act + const createDataInput = getCreateVariantInput(inputData, 1); + + // Assert + expect(createDataInput).toEqual({ + attributes: [], + sku: "23423", + name: "new item", + channelListings: [], + stocks: [], + }); + }); +}); + +describe("getBulkVariantUpdateInputs", () => { + test("should return input data base on datagrid change data for multiple variants", () => { + // Arrange + const variants: ProductFragment["variants"] = + product("http://google.com").variants; + + const inputData: DatagridChangeOpts = { + updates: [ + { + data: "item 1", + column: "name", + row: 1, + }, + { + data: "new item", + column: "name", + row: 2, + }, + { + data: "2345555", + column: "sku", + row: 2, + }, + { + data: { + kind: "money-cell", + value: 234, + currency: "USD", + }, + column: `channel:${variants[2].channelListings[0].channel.id}`, + row: 2, + }, + { + data: { + kind: "money-cell", + value: 565, + currency: "BHD", + }, + column: `channel:${variants[2].channelListings[1].channel.id}`, + row: 2, + }, + { + data: { + kind: "number-cell", + value: 2344, + }, + column: `stock:${variants[2].stocks[0].warehouse.id}`, + row: 2, + }, + { + data: { + allowCustomValues: true, + emptyOption: true, + kind: "dropdown-cell", + value: { + label: "2l", + value: "2l", + }, + }, + column: `attribute:${variants[2].attributes[0].attribute.id}`, + row: 2, + }, + ], + removed: [], + added: [], + }; + + // Act + const bulkVariantUpdateInput = getBulkVariantUpdateInputs( + variants, + inputData, + ); + + // Assert + + expect(bulkVariantUpdateInput).toEqual([ + { + id: variants[1].id, + attributes: [], + name: "item 1", + stocks: { + create: [], + remove: [], + update: [], + }, + channelListings: { + create: [], + remove: [], + update: [], + }, + }, + { + id: variants[2].id, + attributes: [ + { + id: variants[2].attributes[0].attribute.id, + values: ["2l"], + }, + ], + sku: "2345555", + name: "new item", + stocks: { + update: [ + { + stock: variants[2].stocks[0].id, + quantity: 2344, + }, + ], + create: [], + remove: [], + }, + channelListings: { + update: [ + { + channelListing: variants[2].channelListings[0].id, + price: 234, + }, + { + channelListing: variants[2].channelListings[1].id, + price: 565, + }, + ], + remove: [], + create: [], + }, + }, + ]); + }); +}); diff --git a/src/products/views/ProductUpdate/handlers/utils.ts b/src/products/views/ProductUpdate/handlers/utils.ts index 2d12e2c37..5e252f254 100644 --- a/src/products/views/ProductUpdate/handlers/utils.ts +++ b/src/products/views/ProductUpdate/handlers/utils.ts @@ -1,20 +1,31 @@ import { FetchResult } from "@apollo/client"; import { getAttributesAfterFileAttributesUpdate } from "@dashboard/attributes/utils/data"; import { prepareAttributesInput } from "@dashboard/attributes/utils/handlers"; +import { DatagridChangeOpts } from "@dashboard/components/Datagrid/useDatagridChange"; import { VALUES_PAGINATE_BY } from "@dashboard/config"; import { FileUploadMutation, ProductChannelListingAddInput, + ProductChannelListingUpdateInput, ProductChannelListingUpdateMutationVariables, ProductFragment, + ProductVariantBulkUpdateInput, } from "@dashboard/graphql"; import { ProductUpdateSubmitData } from "@dashboard/products/components/ProductUpdatePage/types"; -import { getColumnChannelAvailability } from "@dashboard/products/components/ProductVariants/datagrid/columnData"; import { getAttributeInputFromProduct } from "@dashboard/products/utils/data"; import { getParsedDataForJsonStringField } from "@dashboard/utils/richText/misc"; import pick from "lodash/pick"; import uniq from "lodash/uniq"; +import { getAttributeData } from "./data/attributes"; +import { + getUpdateVariantChannelInputs, + getVariantChannelsInputs, +} from "./data/channel"; +import { getNameData } from "./data/name"; +import { getSkuData } from "./data/sku"; +import { getStockData, getVaraintUpdateStockData } from "./data/stock"; + export function getProductUpdateVariables( product: ProductFragment, data: ProductUpdateSubmitData, @@ -49,34 +60,14 @@ export function getProductUpdateVariables( }; } -const hasChannel = ( - channelId: string, - variant?: ProductFragment["variants"][number], -) => { - if (!variant) { - return false; - } - - return variant.channelListings.some(c => c.channel.id === channelId); -}; - -export function inferProductChannelsAfterUpdate( - product: ProductFragment, - data: ProductUpdateSubmitData, -) { - const productChannelsIds = product.channelListings.map( - listing => listing.channel.id, - ); - const updatedChannelsIds = - data.channels.updateChannels?.map(listing => listing.channelId) || []; - const removedChannelsIds = data.channels.removeChannels || []; - - return uniq([ - ...productChannelsIds.filter( - channelId => !removedChannelsIds.includes(channelId), - ), - ...updatedChannelsIds, - ]); +export function getCreateVariantInput(data: DatagridChangeOpts, index: number) { + return { + attributes: getAttributeData(data.updates, index, data.removed), + sku: getSkuData(data.updates, index, data.removed), + name: getNameData(data.updates, index, data.removed), + channelListings: getVariantChannelsInputs(data, index), + stocks: getStockData(data.updates, index, data.removed), + }; } export function getProductChannelsUpdateVariables( @@ -105,41 +96,10 @@ export function getProductChannelsUpdateVariables( ) .forEach(listing => dataUpdated.set(listing.channelId, listing)); - const variantsUpdates = new Map(); - channels - .map(channelId => ({ - channelId, - addVariants: data.variants.updates - .filter( - change => - !data.variants.added.includes(change.row) && - !hasChannel(channelId, product.variants[change.row]) && - channelId === getColumnChannelAvailability(change.column) && - change.data, - ) - .map(change => product.variants[change.row].id), - removeVariants: data.variants.updates - .filter( - change => - product.variants[change.row] && - channelId === getColumnChannelAvailability(change.column) && - !change.data, - ) - .map(change => product.variants[change.row].id), - })) - .filter( - listing => - listing.addVariants.length > 0 || listing.removeVariants.length > 0, - ) - .forEach(listing => variantsUpdates.set(listing.channelId, listing)); - const updateChannels = channels - .filter( - channelId => dataUpdated.has(channelId) || variantsUpdates.has(channelId), - ) + .filter(channelId => dataUpdated.has(channelId)) .map(channelId => ({ ...dataUpdated.get(channelId), - ...variantsUpdates.get(channelId), })); return { @@ -150,3 +110,63 @@ export function getProductChannelsUpdateVariables( }, }; } + +export function hasProductChannelsUpdate( + data: ProductChannelListingUpdateInput, +) { + return data?.removeChannels?.length || data?.updateChannels?.length; +} + +export function getBulkVariantUpdateInputs( + variants: ProductFragment["variants"], + data: DatagridChangeOpts, +): ProductVariantBulkUpdateInput[] { + const toUpdateInput = createToUpdateInput(data); + return variants.map(toUpdateInput).filter(byAvailability); +} + +const createToUpdateInput = + (data: DatagridChangeOpts) => + (variant, variantIndex): ProductVariantBulkUpdateInput => ({ + id: variant.id, + attributes: getAttributeData(data.updates, variantIndex, data.removed), + sku: getSkuData(data.updates, variantIndex, data.removed), + name: getNameData(data.updates, variantIndex, data.removed), + stocks: getVaraintUpdateStockData( + data.updates, + variantIndex, + data.removed, + variant, + ), + channelListings: getUpdateVariantChannelInputs(data, variantIndex, variant), + }); + +const byAvailability = (variant: ProductVariantBulkUpdateInput): boolean => + variant.name !== undefined || + variant.sku !== undefined || + variant.attributes.length > 0 || + variant.stocks.create.length > 0 || + variant.stocks.update.length > 0 || + variant.stocks.remove.length > 0 || + variant.channelListings.update.length > 0 || + variant.channelListings.remove.length > 0 || + variant.channelListings.create.length > 0; + +export function inferProductChannelsAfterUpdate( + product: ProductFragment, + data: ProductUpdateSubmitData, +) { + const productChannelsIds = product.channelListings.map( + listing => listing.channel.id, + ); + const updatedChannelsIds = + data.channels.updateChannels?.map(listing => listing.channelId) || []; + const removedChannelsIds = data.channels.removeChannels || []; + + return uniq([ + ...productChannelsIds.filter( + channelId => !removedChannelsIds.includes(channelId), + ), + ...updatedChannelsIds, + ]); +}