From 6dbb8e4ecc013e8187eee4e50e3a9f280c313df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Wiaduch?= <2can@users.noreply.github.com> Date: Mon, 30 Jan 2023 13:06:54 +0100 Subject: [PATCH] Webhook query dry run (#2960) --- introspection.json | 3841 +++++------------ locale/defaultMessages.json | 40 + schema.graphql | 804 ++-- src/components/DryRun/DryRun.test.tsx | 42 + src/components/DryRun/DryRun.tsx | 171 + src/components/DryRun/index.ts | 2 + src/components/DryRun/messages.ts | 45 + src/components/DryRun/mutations.ts | 13 + src/components/DryRun/utils.ts | 59 + .../DryRunItemsList/DryRunItemsList.test.tsx | 39 + .../DryRunItemsList/DryRunItemsList.tsx | 106 + src/components/DryRunItemsList/index.ts | 2 + src/components/DryRunItemsList/messages.ts | 9 + src/components/DryRunItemsList/queries.ts | 30 + src/components/DryRunItemsList/utils.ts | 262 ++ src/components/GraphiQL/GraphiQL.tsx | 50 +- src/components/GraphiQL/messages.ts | 9 + src/components/GraphiQL/styles.ts | 3 + .../WebhookEvents/WebhookEvents.tsx | 53 +- .../components/WebhookEvents/styles.ts | 10 +- .../WebhookSubscriptionQuery.test.tsx | 7 +- .../WebhookSubscriptionQuery.tsx | 1 + src/custom-apps/utils.test.ts | 84 +- src/custom-apps/utils.tsx | 64 +- src/graphql/fragmentTypes.generated.ts | 4 +- src/graphql/hooks.generated.ts | 123 + src/graphql/typePolicies.generated.ts | 86 +- src/graphql/types.generated.ts | 183 +- testUtils/mocks/index.ts | 1 + testUtils/mocks/products.ts | 277 ++ 30 files changed, 3262 insertions(+), 3158 deletions(-) create mode 100644 src/components/DryRun/DryRun.test.tsx create mode 100644 src/components/DryRun/DryRun.tsx create mode 100644 src/components/DryRun/index.ts create mode 100644 src/components/DryRun/messages.ts create mode 100644 src/components/DryRun/mutations.ts create mode 100644 src/components/DryRun/utils.ts create mode 100644 src/components/DryRunItemsList/DryRunItemsList.test.tsx create mode 100644 src/components/DryRunItemsList/DryRunItemsList.tsx create mode 100644 src/components/DryRunItemsList/index.ts create mode 100644 src/components/DryRunItemsList/messages.ts create mode 100644 src/components/DryRunItemsList/queries.ts create mode 100644 src/components/DryRunItemsList/utils.ts create mode 100644 src/components/GraphiQL/messages.ts create mode 100644 testUtils/mocks/products.ts diff --git a/introspection.json b/introspection.json index 5328820ca..4d847d263 100644 --- a/introspection.json +++ b/introspection.json @@ -6290,6 +6290,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of this attribute. \n\nAdded in Saleor 3.10.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -6815,6 +6827,18 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of this attribute.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } ], "interfaces": null, @@ -8212,6 +8236,18 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of this product.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } ], "interfaces": null, @@ -8476,6 +8512,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of this attribute value. \n\nAdded in Saleor 3.10.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -8819,6 +8867,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "externalReference", + "description": "External ID of this attribute value.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "name", "description": "Name of a value displayed in the interface.", @@ -9140,7 +9200,7 @@ }, { "name": "values", - "description": "The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created.", + "description": "The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. This field will be removed in Saleor 4.0.", "type": { "kind": "LIST", "name": null, @@ -9158,6 +9218,50 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "dropdown", + "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.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AttributeValueSelectableTypeInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "numeric", + "description": "Numeric value of an attribute.\n\nAdded in Saleor 3.9.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "file", "description": "URL of the file attribute. Every time, a new value is created.", @@ -9267,6 +9371,41 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "AttributeValueSelectableTypeInput", + "description": "Represents attribute value. If no ID provided, value will be resolved. \n\nAdded in Saleor 3.9.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "ID of an attribute value.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "AttributeValueTranslatableContent", @@ -9357,22 +9496,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "attribute", - "description": "Represents a value of an attribute.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AttributeTranslatableContent", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "attributeValue", "description": "Represents a value of an attribute.", @@ -9765,6 +9888,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "externalReference", + "description": "External ID of this attribute value.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "name", "description": "Name of a value displayed in the interface.", @@ -10753,6 +10888,30 @@ "name": "products", "description": "List of products in the category. Requires the following permissions to include the unpublished items: MANAGE_ORDERS, MANAGE_DISCOUNTS, MANAGE_PRODUCTS.", "args": [ + { + "name": "filter", + "description": "Filtering options for products.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ProductFilterInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sortBy", + "description": "Sort products.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "INPUT_OBJECT", + "name": "ProductOrder", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "channel", "description": "Slug of a channel for which the data should be returned.", @@ -22866,6 +23025,18 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of the customer.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } ], "interfaces": null, @@ -25150,6 +25321,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "externalReference", + "description": "External ID of this order.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "lines", "description": "Variant line input consisting of variant ID and quantity of products.", @@ -25525,6 +25708,18 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of this order.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } ], "interfaces": null, @@ -40489,6 +40684,66 @@ ], "possibleTypes": null }, + { + "kind": "ENUM", + "name": "MediaChoicesSortField", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ID", + "description": "Sort media by ID.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "MediaSortingInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "direction", + "description": "Specifies the direction in which to sort products.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "field", + "description": "Sort media by the selected field.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "MediaChoicesSortField", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "Menu", @@ -43853,7 +44108,7 @@ }, { "name": "webhookDelete", - "description": "Deletes a webhook subscription. \n\nRequires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP.", + "description": "Delete a webhook. Before the deletion, the webhook is deactivated to pause any deliveries that are already scheduled. The deletion might fail if delivery is in progress. In such a case, the webhook is not deleted but remains deactivated. \n\nRequires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP.", "args": [ { "name": "id", @@ -43954,6 +44209,96 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "webhookDryRun", + "description": "Performs a dry run of a webhook event. \n\nRequires one of the following permissions: MANAGE_APPS.", + "args": [ + { + "name": "objectId", + "description": "The ID of an object to serialize.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "query", + "description": "The subscription query that defines the webhook event and its payload.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "WebhookDryRun", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "webhookTrigger", + "description": "Trigger a webhook event. \n\nRequires one of the following permissions: MANAGE_APPS.", + "args": [ + { + "name": "objectId", + "description": "The ID of an object to serialize.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "webhookId", + "description": "The ID of the webhook.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "WebhookTrigger", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "createWarehouse", "description": "Creates new warehouse. \n\nRequires one of the following permissions: MANAGE_PRODUCTS.", @@ -44393,207 +44738,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "taxExemptionManage", - "description": "Exempt checkout or order from charging the taxes. When tax exemption is enabled, taxes won't be charged for the checkout or order. Taxes may still be calculated in cases when product prices are entered with the tax included and the net price needs to be known.\n\nAdded in Saleor 3.8.\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_TAXES.", - "args": [ - { - "name": "id", - "description": "ID of a tax class to delete.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "TaxClassDelete", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxClassUpdate", - "description": "Update a tax class.\n\nAdded in Saleor 3.9.\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_TAXES.", - "args": [ - { - "name": "id", - "description": "ID of the tax class.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "input", - "description": "Fields required to update a tax class.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "TaxClassUpdateInput", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "TaxClassUpdate", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxConfigurationUpdate", - "description": "Update tax configuration for a channel.\n\nAdded in Saleor 3.9.\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_TAXES.", - "args": [ - { - "name": "id", - "description": "ID of the tax configuration.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "input", - "description": "Fields required to update the tax configuration.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "TaxConfigurationUpdateInput", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "TaxConfigurationUpdate", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxCountryConfigurationUpdate", - "description": "Update tax class rates for a specific country.\n\nAdded in Saleor 3.9.\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_TAXES.", - "args": [ - { - "name": "countryCode", - "description": "Country in which to update the tax class rates.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "CountryCode", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updateTaxClassRates", - "description": "List of tax rates per tax class to update. When `{taxClass: id, rate: null`} is passed, it deletes the rate object for given taxClass ID. When `{rate: Int}` is passed without a tax class, it updates the default tax class for this country.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "TaxClassRateInput", - "ofType": null - } - } - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "TaxCountryConfigurationUpdate", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxCountryConfigurationDelete", - "description": "Remove all tax class rates for a specific country.\n\nAdded in Saleor 3.9.\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_TAXES.", - "args": [ - { - "name": "countryCode", - "description": "Country in which to update the tax class rates.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "CountryCode", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "TaxCountryConfigurationDelete", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "taxExemptionManage", "description": "Exempt checkout or order from charging the taxes. When tax exemption is enabled, taxes won't be charged for the checkout or order. Taxes may still be calculated in cases when product prices are entered with the tax included and the net price needs to be known.\n\nAdded in Saleor 3.8.\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_TAXES.", @@ -46230,17 +46374,25 @@ "name": "productDelete", "description": "Deletes a product. \n\nRequires one of the following permissions: MANAGE_PRODUCTS.", "args": [ + { + "name": "externalReference", + "description": "External ID of a product to delete. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": "ID of a product to delete.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -46296,17 +46448,25 @@ "name": "productUpdate", "description": "Updates an existing product. \n\nRequires one of the following permissions: MANAGE_PRODUCTS.", "args": [ + { + "name": "externalReference", + "description": "External ID of a product to update. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": "ID of a product to update.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -47148,6 +47308,18 @@ "name": "productVariantDelete", "description": "Deletes a product variant. \n\nRequires one of the following permissions: MANAGE_PRODUCTS.", "args": [ + { + "name": "externalReference", + "description": "External ID of a product variant to update. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": "ID of a product variant to delete.", @@ -47462,9 +47634,21 @@ "name": "productVariantUpdate", "description": "Updates an existing variant for product. \n\nRequires one of the following permissions: MANAGE_PRODUCTS.", "args": [ + { + "name": "externalReference", + "description": "External ID of a product variant to update. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", - "description": "ID of a product variant to update.", + "description": "ID of a product to update.", "type": { "kind": "SCALAR", "name": "ID", @@ -48907,16 +49091,24 @@ "description": "Deletes a draft order. \n\nRequires one of the following permissions: MANAGE_ORDERS.", "args": [ { - "name": "id", - "description": "ID of a draft order to delete.", + "name": "externalReference", + "description": "External ID of a product to delete. \n\nAdded in Saleor 3.10.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "ID of a product to delete.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -49009,17 +49201,25 @@ "name": "draftOrderUpdate", "description": "Updates a draft order. \n\nRequires one of the following permissions: MANAGE_ORDERS.", "args": [ + { + "name": "externalReference", + "description": "External ID of a draft order to update. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": "ID of a draft order to update.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -49882,17 +50082,25 @@ "name": "orderUpdate", "description": "Updates an order. \n\nRequires one of the following permissions: MANAGE_ORDERS.", "args": [ + { + "name": "externalReference", + "description": "External ID of an order to update. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": "ID of an order to update.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -53600,17 +53808,25 @@ "name": "attributeDelete", "description": "Deletes an attribute. \n\nRequires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.", "args": [ + { + "name": "externalReference", + "description": "External ID of an attribute to delete. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": "ID of an attribute to delete.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -53629,17 +53845,25 @@ "name": "attributeUpdate", "description": "Updates attribute. \n\nRequires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.", "args": [ + { + "name": "externalReference", + "description": "External ID of an attribute to update. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": "ID of an attribute to update.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -53854,17 +54078,25 @@ "name": "attributeValueDelete", "description": "Deletes a value of an attribute. \n\nRequires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.", "args": [ + { + "name": "externalReference", + "description": "External ID of a value to delete. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": "ID of a value to delete.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -53883,17 +54115,25 @@ "name": "attributeValueUpdate", "description": "Updates value of an attribute. \n\nRequires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.", "args": [ + { + "name": "externalReference", + "description": "External ID of an AttributeValue to update. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": "ID of an AttributeValue to update.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -55597,17 +55837,25 @@ "name": "customerUpdate", "description": "Updates an existing customer. \n\nRequires one of the following permissions: MANAGE_USERS.", "args": [ + { + "name": "externalReference", + "description": "External ID of a customer to update. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": "ID of a customer to update.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -55642,17 +55890,25 @@ "name": "customerDelete", "description": "Deletes a customer. \n\nRequires one of the following permissions: MANAGE_USERS.", "args": [ + { + "name": "externalReference", + "description": "External ID of a customer to update. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "id", "description": "ID of a customer to delete.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -58100,6 +58356,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of this order. \n\nAdded in Saleor 3.10.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -64061,6 +64329,18 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of this order.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } ], "interfaces": null, @@ -72648,6 +72928,35 @@ "isDeprecated": true, "deprecationReason": "This field will be removed in Saleor 4.0. Use `taxClass` field instead." }, + { + "name": "attribute", + "description": "Get a single attribute attached to product by attribute slug.\n\nAdded in Saleor 3.9.", + "args": [ + { + "name": "slug", + "description": "Slug of the attribute", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SelectedAttribute", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "attributes", "description": "List of attributes assigned to this product.", @@ -72742,6 +73051,43 @@ "isDeprecated": true, "deprecationReason": "This field will be removed in Saleor 4.0. Use the `mediaById` field instead." }, + { + "name": "variant", + "description": "Get a single variant by SKU or ID. \n\nAdded in Saleor 3.9.", + "args": [ + { + "name": "id", + "description": "ID of the variant.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sku", + "description": "SKU of the variant.", + "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": "variants", "description": "List of variants for the product. Requires the following permissions to include the unpublished items: MANAGE_ORDERS, MANAGE_DISCOUNTS, MANAGE_PRODUCTS.", @@ -72765,7 +73111,20 @@ { "name": "media", "description": "List of media for the product.", - "args": [], + "args": [ + { + "name": "sortBy", + "description": "Sort media. \n\nAdded in Saleor 3.9.", + "type": { + "kind": "INPUT_OBJECT", + "name": "MediaSortingInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], "type": { "kind": "LIST", "name": null, @@ -72898,6 +73257,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of this product. \n\nAdded in Saleor 3.10.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -74314,6 +74685,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "externalReference", + "description": "External ID of this product.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "productType", "description": "ID of the type that product belongs to.", @@ -75537,6 +75920,18 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of this product.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } ], "interfaces": null, @@ -77414,18 +77809,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "taxClass", - "description": "Tax class assigned to this product type. All products of this product type use this tax class, unless it's overridden in the `Product` type.\n\nRequires one of the following permissions: MANAGE_TAXES, MANAGE_PRODUCTS, MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "TaxClass", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "variantAttributes", "description": "Variant attributes of that product type.", @@ -79285,6 +79668,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of this product. \n\nAdded in Saleor 3.10.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -79646,6 +80041,18 @@ "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 of a product available for sale.", @@ -80320,6 +80727,18 @@ "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": "product", "description": "Product ID of which type is the variant.", @@ -80836,6 +81255,18 @@ "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 } ], "interfaces": null, @@ -82130,15 +82561,23 @@ "args": [ { "name": "id", - "description": "ID of an warehouse", + "description": "ID of a warehouse.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of a warehouse. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -83295,6 +83734,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "externalReference", + "description": "External ID of the product. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "channel", "description": "Slug of a channel for which the data should be returned.", @@ -83555,6 +84006,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "externalReference", + "description": "External ID of the product. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "channel", "description": "Slug of a channel for which the data should be returned.", @@ -84216,19 +84679,27 @@ }, { "name": "order", - "description": "Look up an order by ID.", + "description": "Look up an order by ID or external reference.", "args": [ { "name": "id", "description": "ID of an order.", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of an order. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -85897,7 +86368,7 @@ }, { "name": "attribute", - "description": "Look up an attribute by ID.", + "description": "Look up an attribute by ID, slug or external reference.", "args": [ { "name": "id", @@ -85922,6 +86393,18 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of the attribute. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } ], "type": { @@ -86585,6 +87068,18 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of the user. \n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } ], "type": { @@ -94379,6 +94874,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "schemaVersion", + "description": "Minor Saleor API version.\n\nAdded in Saleor 3.5.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "includeTaxesInPrices", "description": "Include taxes in prices.", @@ -99408,2334 +99919,6 @@ ], "possibleTypes": null }, - { - "kind": "OBJECT", - "name": "TaxClass", - "description": "Tax class is a named object used to define tax rates per country. Tax class can be assigned to product types, products and shipping methods to define their tax rates.\n\nAdded in Saleor 3.5.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", - "fields": [ - { - "name": "id", - "description": "The ID of the object.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "privateMetadata", - "description": "List of private metadata items. Requires staff permissions to access.", - "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.3.\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.3.\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.", - "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.3.\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.3.\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": "name", - "description": "Name of the tax class.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "countries", - "description": "Country-specific tax rates for this tax class.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TaxClassCountryRate", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - }, - { - "kind": "INTERFACE", - "name": "ObjectWithMetadata", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxClassCountableConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TaxClassCountableEdge", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": "A total count of items in the collection.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxClassCountableEdge", - "description": null, - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TaxClass", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxClassCountryRate", - "description": "Tax rate for a country. When tax class is null, it represents the default tax rate for that country; otherwise it's a country tax rate specific to the given tax class.\n\nAdded in Saleor 3.9.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", - "fields": [ - { - "name": "country", - "description": "Country in which this tax rate applies.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CountryDisplay", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rate", - "description": "Tax rate value.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxClass", - "description": "Related tax class.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "TaxClass", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxClassCreate", - "description": "Create a tax class.\n\nAdded in Saleor 3.9.\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_TAXES.", - "fields": [ - { - "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": "TaxClassCreateError", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxClass", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "TaxClass", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxClassCreateError", - "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": "TaxClassCreateErrorCode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "countryCodes", - "description": "List of country codes for which the configuration is invalid.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "TaxClassCreateErrorCode", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "GRAPHQL_ERROR", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INVALID", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NOT_FOUND", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "TaxClassCreateInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "name", - "description": "Name of the tax class.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createCountryRates", - "description": "List of country-specific tax rates to create for this tax class.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CountryRateInput", - "ofType": null - } - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxClassDelete", - "description": "Delete a tax class. After deleting the tax class any products, product types or shipping methods using it are updated to use the default tax class.\n\nAdded in Saleor 3.9.\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_TAXES.", - "fields": [ - { - "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": "TaxClassDeleteError", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxClass", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "TaxClass", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxClassDeleteError", - "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": "TaxClassDeleteErrorCode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "TaxClassDeleteErrorCode", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "GRAPHQL_ERROR", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INVALID", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NOT_FOUND", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "TaxClassFilterInput", - "description": null, - "fields": null, - "inputFields": [ - { - "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": "countries", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "CountryCode", - "ofType": null - } - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "TaxClassRateInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "taxClassId", - "description": "ID of a tax class for which to update the tax rate", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rate", - "description": "Tax rate value.", - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "TaxClassSortField", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "NAME", - "description": "Sort tax classes by name.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "TaxClassSortingInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "direction", - "description": "Specifies the direction in which to sort products.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "OrderDirection", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "field", - "description": "Sort tax classes by the selected field.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "TaxClassSortField", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxClassUpdate", - "description": "Update a tax class.\n\nAdded in Saleor 3.9.\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_TAXES.", - "fields": [ - { - "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": "TaxClassUpdateError", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxClass", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "TaxClass", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxClassUpdateError", - "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": "TaxClassUpdateErrorCode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "countryCodes", - "description": "List of country codes for which the configuration is invalid.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "TaxClassUpdateErrorCode", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "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": "NOT_FOUND", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "TaxClassUpdateInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "name", - "description": "Name of the tax class.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updateCountryRates", - "description": "List of country-specific tax rates to create or update for this tax class.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CountryRateUpdateInput", - "ofType": null - } - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "removeCountryRates", - "description": "List of country codes for which to remove the tax class rates. Note: It removes all rates for given country code.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "CountryCode", - "ofType": null - } - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxConfiguration", - "description": "Channel-specific tax configuration.\n\nAdded in Saleor 3.9.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", - "fields": [ - { - "name": "id", - "description": "The ID of the object.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "privateMetadata", - "description": "List of private metadata items. Requires staff permissions to access.", - "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.3.\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.3.\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.", - "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.3.\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.3.\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": "channel", - "description": "A channel to which the tax configuration applies to.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Channel", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "chargeTaxes", - "description": "Determines whether taxes are charged in the given channel.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxCalculationStrategy", - "description": "The default strategy to use for tax calculation in the given channel. Taxes can be calculated either using user-defined flat rates or with a tax app. Empty value means that no method is selected and taxes are not calculated.", - "args": [], - "type": { - "kind": "ENUM", - "name": "TaxCalculationStrategy", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "displayGrossPrices", - "description": "Determines whether prices displayed in a storefront should include taxes.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pricesEnteredWithTax", - "description": "Determines whether prices are entered with the tax included.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "countries", - "description": "List of country-specific exceptions in tax configuration.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TaxConfigurationPerCountry", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - }, - { - "kind": "INTERFACE", - "name": "ObjectWithMetadata", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxConfigurationCountableConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TaxConfigurationCountableEdge", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": "A total count of items in the collection.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxConfigurationCountableEdge", - "description": null, - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TaxConfiguration", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "TaxConfigurationFilterInput", - "description": null, - "fields": null, - "inputFields": [ - { - "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 - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxConfigurationPerCountry", - "description": "Country-specific exceptions of a channel's tax configuration.\n\nAdded in Saleor 3.9.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", - "fields": [ - { - "name": "country", - "description": "Country in which this configuration applies.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CountryDisplay", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "chargeTaxes", - "description": "Determines whether taxes are charged in this country.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxCalculationStrategy", - "description": "A country-specific strategy to use for tax calculation. Taxes can be calculated either using user-defined flat rates or with a tax app. If not provided, use the value from the channel's tax configuration.", - "args": [], - "type": { - "kind": "ENUM", - "name": "TaxCalculationStrategy", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "displayGrossPrices", - "description": "Determines whether prices displayed in a storefront should include taxes for this country.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "TaxConfigurationPerCountryInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "countryCode", - "description": "Country in which this configuration applies.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "CountryCode", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "chargeTaxes", - "description": "Determines whether taxes are charged in this country.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxCalculationStrategy", - "description": "A country-specific strategy to use for tax calculation. Taxes can be calculated either using user-defined flat rates or with a tax app. If not provided, use the value from the channel's tax configuration.", - "type": { - "kind": "ENUM", - "name": "TaxCalculationStrategy", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "displayGrossPrices", - "description": "Determines whether prices displayed in a storefront should include taxes for this country.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxConfigurationUpdate", - "description": "Update tax configuration for a channel.\n\nAdded in Saleor 3.9.\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_TAXES.", - "fields": [ - { - "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": "TaxConfigurationUpdateError", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxConfiguration", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "TaxConfiguration", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxConfigurationUpdateError", - "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": "TaxConfigurationUpdateErrorCode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "countryCodes", - "description": "List of country codes for which the configuration is invalid.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "TaxConfigurationUpdateErrorCode", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "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": "NOT_FOUND", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "TaxConfigurationUpdateInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "chargeTaxes", - "description": "Determines whether taxes are charged in the given channel.", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxCalculationStrategy", - "description": "The default strategy to use for tax calculation in the given channel. Taxes can be calculated either using user-defined flat rates or with a tax app. Empty value means that no method is selected and taxes are not calculated.", - "type": { - "kind": "ENUM", - "name": "TaxCalculationStrategy", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "displayGrossPrices", - "description": "Determines whether prices displayed in a storefront should include taxes.", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pricesEnteredWithTax", - "description": "Determines whether prices are entered with the tax included.", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updateCountriesConfiguration", - "description": "List of tax country configurations to create or update (identified by a country code).", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "TaxConfigurationPerCountryInput", - "ofType": null - } - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "removeCountriesConfiguration", - "description": "List of country codes for which to remove the tax configuration.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "CountryCode", - "ofType": null - } - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxCountryConfiguration", - "description": "Tax class rates grouped by country.\n\nAdded in Saleor 3.9.\n\nNote: this API is currently in Feature Preview and can be subject to changes at later point.", - "fields": [ - { - "name": "country", - "description": "A country for which tax class rates are grouped.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CountryDisplay", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxClassCountryRates", - "description": "List of tax class rates.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TaxClassCountryRate", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxCountryConfigurationDelete", - "description": "Remove all tax class rates for a specific country.\n\nAdded in Saleor 3.9.\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_TAXES.", - "fields": [ - { - "name": "taxCountryConfiguration", - "description": "Updated tax class rates grouped by a country.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "TaxCountryConfiguration", - "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": "TaxCountryConfigurationDeleteError", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxCountryConfigurationDeleteError", - "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": "TaxCountryConfigurationDeleteErrorCode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "TaxCountryConfigurationDeleteErrorCode", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "GRAPHQL_ERROR", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INVALID", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NOT_FOUND", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxCountryConfigurationUpdate", - "description": "Update tax class rates for a specific country.\n\nAdded in Saleor 3.9.\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_TAXES.", - "fields": [ - { - "name": "taxCountryConfiguration", - "description": "Updated tax class rates grouped by a country.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "TaxCountryConfiguration", - "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": "TaxCountryConfigurationUpdateError", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TaxCountryConfigurationUpdateError", - "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": "TaxCountryConfigurationUpdateErrorCode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taxClassIds", - "description": "List of tax class IDs for which the update failed.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "TaxCountryConfigurationUpdateErrorCode", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "GRAPHQL_ERROR", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INVALID", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NOT_FOUND", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ONLY_ONE_DEFAULT_COUNTRY_RATE_ALLOWED", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CANNOT_CREATE_NEGATIVE_RATE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, { "kind": "OBJECT", "name": "TaxExemptionManage", @@ -105948,6 +104131,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "externalReference", + "description": "External ID of this user. \n\nAdded in Saleor 3.10.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "lastLogin", "description": null, @@ -106434,6 +104629,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "externalReference", + "description": "External ID of the customer.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "redirectUrl", "description": "URL of a view where users should be redirected to set the password. URL in RFC 1808 format.", @@ -110182,6 +108389,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "externalReference", + "description": "External ID of this warehouse. \n\nAdded in Saleor 3.10.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -110436,6 +108655,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "externalReference", + "description": "External ID of the warehouse.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "name", "description": "Warehouse name.", @@ -111323,6 +109554,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "externalReference", + "description": "External ID of the warehouse.\n\nAdded in Saleor 3.10.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "name", "description": "Warehouse name.", @@ -111948,7 +110191,7 @@ { "kind": "OBJECT", "name": "WebhookDelete", - "description": "Deletes a webhook subscription. \n\nRequires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP.", + "description": "Delete a webhook. Before the deletion, the webhook is deactivated to pause any deliveries that are already scheduled. The deletion might fail if delivery is in progress. In such a case, the webhook is not deleted but remains deactivated. \n\nRequires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP.", "fields": [ { "name": "webhookErrors", @@ -112016,6 +110259,139 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "WebhookDryRun", + "description": "Performs a dry run of a webhook event. \n\nRequires one of the following permissions: MANAGE_APPS.", + "fields": [ + { + "name": "payload", + "description": "JSON payload, that would be sent out to webhook's target URL.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "JSONString", + "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": "WebhookDryRunError", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "WebhookDryRunError", + "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": "WebhookDryRunErrorCode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "WebhookDryRunErrorCode", + "description": "An enumeration.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "GRAPHQL_ERROR", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NOT_FOUND", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INVALID_ID", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MISSING_PERMISSION", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, { "kind": "OBJECT", "name": "WebhookError", @@ -112104,6 +110480,12 @@ "description": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "DELETE_FAILED", + "description": null, + "isDeprecated": false, + "deprecationReason": null } ], "possibleTypes": null @@ -114345,6 +112727,145 @@ ], "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "WebhookTrigger", + "description": "Trigger a webhook event. \n\nRequires one of the following permissions: MANAGE_APPS.", + "fields": [ + { + "name": "delivery", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "EventDelivery", + "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": "WebhookTriggerError", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "WebhookTriggerError", + "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": "WebhookTriggerErrorCode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "WebhookTriggerErrorCode", + "description": "An enumeration.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "GRAPHQL_ERROR", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NOT_FOUND", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INVALID_ID", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MISSING_PERMISSION", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MISSING_QUERY", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, { "kind": "OBJECT", "name": "WebhookUpdate", @@ -114709,7 +113230,7 @@ }, { "kind": "OBJECT", - "name": "Collection", + "name": "ProductMedia", "ofType": null }, { @@ -114719,7 +113240,7 @@ }, { "kind": "OBJECT", - "name": "ProductMedia", + "name": "Collection", "ofType": null }, { diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index 109b956d4..33b4dbe62 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -51,6 +51,10 @@ "context": "tabel column header", "string": "Total" }, + "+RffqY": { + "context": "Dry run dialog object title", + "string": "Select object type to perform dry run on provided query" + }, "+RjQjs": { "context": "return button", "string": "Return / Replace order" @@ -390,6 +394,10 @@ "context": "selected customer channel subtitle", "string": "Customer will be sent the gift card code via this channels email address" }, + "0u9Ng0": { + "context": "Dry run no objects found", + "string": "No objects found in the provided query" + }, "0vsMRq": { "context": "delete custom app", "string": "Deleting this app, you will delete all the data and webhooks regarding this app." @@ -800,6 +808,10 @@ "context": "open full-screen", "string": "Open" }, + "48dMqY": { + "context": "Dry run trigger button", + "string": "Run" + }, "4B32Ba": { "context": "delete page", "string": "Are you sure you want to delete {title}?" @@ -993,6 +1005,10 @@ "context": "tabel column header", "string": "Price" }, + "5b0Boq": { + "context": "Dry run items list default message", + "string": "Choose the object" + }, "5bJ26s": { "string": "Successfully created page type" }, @@ -1591,6 +1607,10 @@ "context": "sale status", "string": "Active" }, + "ApNw0L": { + "context": "Dry run objects unavailable", + "string": "The following objects are currently not available for dry run:" + }, "AqHafs": { "context": "provided email input placeholder", "string": "Provided email address" @@ -3651,6 +3671,10 @@ "context": "modal button url upload", "string": "Upload URL" }, + "Q2us5X": { + "context": "Dry run icon label", + "string": "Dry run" + }, "Q47ovw": { "context": "activate app", "string": "Are you sure you want to activate this app? Activating will start gathering events." @@ -4767,6 +4791,10 @@ "context": "header", "string": "Edit Authorization Field" }, + "Xz/sDf": { + "context": "Dry run items list item", + "string": "Item:" + }, "Y1B0PN": { "context": "error message", "string": "There's no payment associated with the order" @@ -4962,6 +4990,10 @@ "context": "subsection header", "string": "Shipping Address" }, + "ZepEWY": { + "context": "Dry run item", + "string": "Item" + }, "Zg0dRo": { "context": "dialog description", "string": "You have changed customer assigned to this order. What would you like to do with the shipping address?" @@ -5647,6 +5679,10 @@ "fhksPD": { "string": "Number of Orders" }, + "fi9Qa/": { + "context": "Dry run dialog header", + "string": "Dry run" + }, "fjPWOA": { "context": "header", "string": "Customer Overview" @@ -7472,6 +7508,10 @@ "ubmFc8": { "string": "Install" }, + "uccjUM": { + "context": "Dry run objects", + "string": "Objects" + }, "ud0w8h": { "context": "number of postal code ranges", "string": "{number} postal code ranges" diff --git a/schema.graphql b/schema.graphql index 1b0f8513d..c590fcbf8 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1221,6 +1221,13 @@ type Attribute implements Node & ObjectWithMetadata { """Return the last n elements from the list.""" last: Int ): ProductTypeCountableConnection! + + """ + External ID of this attribute. + + Added in Saleor 3.10. + """ + externalReference: String } """ @@ -1319,6 +1326,13 @@ input AttributeCreateInput { """Whether the attribute can be displayed in the admin product list.""" availableInGrid: Boolean + + """ + External ID of this attribute. + + Added in Saleor 3.10. + """ + externalReference: String } """ @@ -1609,6 +1623,13 @@ input AttributeUpdateInput { """Whether the attribute can be displayed in the admin product list.""" availableInGrid: Boolean + + """ + External ID of this product. + + Added in Saleor 3.10. + """ + externalReference: String } """ @@ -1685,6 +1706,13 @@ type AttributeValue implements Node { """Represents the date/time value of the attribute value.""" dateTime: DateTime + + """ + External ID of this attribute value. + + Added in Saleor 3.10. + """ + externalReference: String } """ @@ -1757,6 +1785,13 @@ input AttributeValueCreateInput { """File content type.""" contentType: String + """ + External ID of this attribute value. + + Added in Saleor 3.10. + """ + externalReference: String + """Name of a value displayed in the interface.""" name: String! } @@ -1832,10 +1867,31 @@ input AttributeValueInput { id: ID """ - The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. + The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. This field will be removed in Saleor 4.0. """ values: [String!] + """ + Attribute value ID. + + Added in Saleor 3.9. + """ + dropdown: AttributeValueSelectableTypeInput + + """ + List of attribute value IDs. + + Added in Saleor 3.9. + """ + multiselect: [AttributeValueSelectableTypeInput!] + + """ + Numeric value of an attribute. + + Added in Saleor 3.9. + """ + numeric: String + """URL of the file attribute. Every time, a new value is created.""" file: String @@ -1861,6 +1917,21 @@ input AttributeValueInput { dateTime: DateTime } +""" +Represents attribute value. If no ID provided, value will be resolved. + +Added in Saleor 3.9. +""" +input AttributeValueSelectableTypeInput { + """ID of an attribute value.""" + id: ID + + """ + The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. + """ + value: String +} + type AttributeValueTranslatableContent implements Node { id: ID! name: String! @@ -1881,9 +1952,6 @@ type AttributeValueTranslatableContent implements Node { languageCode: LanguageCodeEnum! ): AttributeValueTranslation - """Represents an attribute.""" - attribute: Attribute! - """Represents a value of an attribute.""" attributeValue: AttributeValue @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") @@ -1979,6 +2047,13 @@ input AttributeValueUpdateInput { """File content type.""" contentType: String + """ + External ID of this attribute value. + + Added in Saleor 3.10. + """ + externalReference: String + """Name of a value displayed in the interface.""" name: String } @@ -2216,6 +2291,20 @@ type Category implements Node & ObjectWithMetadata { List of products in the category. Requires the following permissions to include the unpublished items: MANAGE_ORDERS, MANAGE_DISCOUNTS, MANAGE_PRODUCTS. """ products( + """ + Filtering options for products. + + Added in Saleor 3.10. + """ + filter: ProductFilterInput + + """ + Sort products. + + Added in Saleor 3.10. + """ + sortBy: ProductOrder + """Slug of a channel for which the data should be returned.""" channel: String @@ -2715,30 +2804,6 @@ type ChannelCreated implements Event { channel: Channel } -""" -Event sent when new channel is created. - -Added in Saleor 3.2. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -type ChannelCreated 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 channel the event relates to.""" - channel: Channel -} - """ Deactivate a channel. @@ -4002,33 +4067,6 @@ type CollectionCreated implements Event { ): Collection } -""" -Event sent when new collection is created. - -Added in Saleor 3.2. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -type CollectionCreated 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 collection the event relates to.""" - collection( - """Slug of a channel for which the data should be returned.""" - channel: String - ): Collection -} - """ Deletes a collection. @@ -4889,6 +4927,13 @@ input CustomerInput { """User language code.""" languageCode: LanguageCodeEnum + + """ + External ID of the customer. + + Added in Saleor 3.10. + """ + externalReference: String } """ @@ -5358,6 +5403,13 @@ input DraftOrderCreateInput { """ redirectUrl: String + """ + External ID of this order. + + Added in Saleor 3.10. + """ + externalReference: String + """Variant line input consisting of variant ID and quantity of products.""" lines: [OrderLineCreateInput!] } @@ -5386,30 +5438,6 @@ type DraftOrderCreated implements Event { order: Order } -""" -Event sent when new draft order is created. - -Added in Saleor 3.2. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -type DraftOrderCreated 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 order the event relates to.""" - order: Order -} - """ Deletes a draft order. @@ -5477,6 +5505,13 @@ input DraftOrderInput { URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. """ redirectUrl: String + + """ + External ID of this order. + + Added in Saleor 3.10. + """ + externalReference: String } """ @@ -6752,30 +6787,6 @@ type GiftCardCreated implements Event { giftCard: GiftCard } -""" -Event sent when new gift card is created. - -Added in Saleor 3.2. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -type GiftCardCreated 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 gift card the event relates to.""" - giftCard: GiftCard -} - """ Deactivate a gift card. @@ -8433,6 +8444,19 @@ enum MeasurementUnitsEnum { TONNE } +enum MediaChoicesSortField { + """Sort media by ID.""" + ID +} + +input MediaSortingInput { + """Specifies the direction in which to sort products.""" + direction: OrderDirection! + + """Sort media by the selected field.""" + field: MediaChoicesSortField! +} + """ Represents a single menu - an object that is used to help navigate through the store. """ @@ -9146,7 +9170,7 @@ type Mutation { ): WebhookCreate """ - Deletes a webhook subscription. + Delete a webhook. Before the deletion, the webhook is deactivated to pause any deliveries that are already scheduled. The deletion might fail if delivery is in progress. In such a case, the webhook is not deleted but remains deactivated. Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. """ @@ -9178,6 +9202,32 @@ type Mutation { id: ID! ): EventDeliveryRetry + """ + Performs a dry run of a webhook event. + + Requires one of the following permissions: MANAGE_APPS. + """ + webhookDryRun( + """The ID of an object to serialize.""" + objectId: ID! + + """The subscription query that defines the webhook event and its payload.""" + query: String! + ): WebhookDryRun + + """ + Trigger a webhook event. + + Requires one of the following permissions: MANAGE_APPS. + """ + webhookTrigger( + """The ID of an object to serialize.""" + objectId: ID! + + """The ID of the webhook.""" + webhookId: ID! + ): WebhookTrigger + """ Creates new warehouse. @@ -9819,8 +9869,15 @@ type Mutation { Requires one of the following permissions: MANAGE_PRODUCTS. """ productDelete( + """ + External ID of a product to delete. + + Added in Saleor 3.10. + """ + externalReference: String + """ID of a product to delete.""" - id: ID! + id: ID ): ProductDelete """ @@ -9839,8 +9896,15 @@ type Mutation { Requires one of the following permissions: MANAGE_PRODUCTS. """ productUpdate( + """ + External ID of a product to update. + + Added in Saleor 3.10. + """ + externalReference: String + """ID of a product to update.""" - id: ID! + id: ID """Fields required to update a product.""" input: ProductInput! @@ -10079,6 +10143,13 @@ type Mutation { Requires one of the following permissions: MANAGE_PRODUCTS. """ productVariantDelete( + """ + External ID of a product variant to update. + + Added in Saleor 3.10. + """ + externalReference: String + """ID of a product variant to delete.""" id: ID @@ -10171,7 +10242,14 @@ type Mutation { Requires one of the following permissions: MANAGE_PRODUCTS. """ productVariantUpdate( - """ID of a product variant to update.""" + """ + External ID of a product variant to update. + + Added in Saleor 3.10. + """ + externalReference: String + + """ID of a product to update.""" id: ID """Fields required to update a product variant.""" @@ -10596,8 +10674,15 @@ type Mutation { Requires one of the following permissions: MANAGE_ORDERS. """ draftOrderDelete( - """ID of a draft order to delete.""" - id: ID! + """ + External ID of a product to delete. + + Added in Saleor 3.10. + """ + externalReference: String + + """ID of a product to delete.""" + id: ID ): DraftOrderDelete """ @@ -10626,8 +10711,15 @@ type Mutation { Requires one of the following permissions: MANAGE_ORDERS. """ draftOrderUpdate( + """ + External ID of a draft order to update. + + Added in Saleor 3.10. + """ + externalReference: String + """ID of a draft order to update.""" - id: ID! + id: ID """Fields required to update an order.""" input: DraftOrderInput! @@ -10889,8 +10981,15 @@ type Mutation { Requires one of the following permissions: MANAGE_ORDERS. """ orderUpdate( + """ + External ID of an order to update. + + Added in Saleor 3.10. + """ + externalReference: String + """ID of an order to update.""" - id: ID! + id: ID """Fields required to update an order.""" input: OrderUpdateInput! @@ -12177,8 +12276,15 @@ type Mutation { Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. """ attributeDelete( + """ + External ID of an attribute to delete. + + Added in Saleor 3.10. + """ + externalReference: String + """ID of an attribute to delete.""" - id: ID! + id: ID ): AttributeDelete """ @@ -12187,8 +12293,15 @@ type Mutation { Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. """ attributeUpdate( + """ + External ID of an attribute to update. + + Added in Saleor 3.10. + """ + externalReference: String + """ID of an attribute to update.""" - id: ID! + id: ID """Fields required to update an attribute.""" input: AttributeUpdateInput! @@ -12247,8 +12360,15 @@ type Mutation { Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. """ attributeValueDelete( + """ + External ID of a value to delete. + + Added in Saleor 3.10. + """ + externalReference: String + """ID of a value to delete.""" - id: ID! + id: ID ): AttributeValueDelete """ @@ -12257,8 +12377,15 @@ type Mutation { Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. """ attributeValueUpdate( + """ + External ID of an AttributeValue to update. + + Added in Saleor 3.10. + """ + externalReference: String + """ID of an AttributeValue to update.""" - id: ID! + id: ID """Fields required to update an AttributeValue.""" input: AttributeValueUpdateInput! @@ -12745,8 +12872,15 @@ type Mutation { Requires one of the following permissions: MANAGE_USERS. """ customerUpdate( + """ + External ID of a customer to update. + + Added in Saleor 3.10. + """ + externalReference: String + """ID of a customer to update.""" - id: ID! + id: ID """Fields required to update a customer.""" input: CustomerInput! @@ -12758,8 +12892,15 @@ type Mutation { Requires one of the following permissions: MANAGE_USERS. """ customerDelete( + """ + External ID of a customer to update. + + Added in Saleor 3.10. + """ + externalReference: String + """ID of a customer to delete.""" - id: ID! + id: ID ): CustomerDelete """ @@ -13237,6 +13378,13 @@ type Order implements Node & ObjectWithMetadata { Note: this API is currently in Feature Preview and can be subject to changes at later point. """ displayGrossPrices: Boolean! + + """ + External ID of this order. + + Added in Saleor 3.10. + """ + externalReference: String } enum OrderAction { @@ -14517,6 +14665,13 @@ input OrderUpdateInput { """Shipping address of the customer.""" shippingAddress: AddressInput + + """ + External ID of this order. + + Added in Saleor 3.10. + """ + externalReference: String } """ @@ -14562,30 +14717,6 @@ type OrderUpdated implements Event { order: Order } -""" -Event sent when order is updated. - -Added in Saleor 3.2. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -type OrderUpdated 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 order the event relates to.""" - order: Order -} - """ Void an order. @@ -14830,30 +14961,6 @@ type PageCreated implements Event { page: Page } -""" -Event sent when new page is created. - -Added in Saleor 3.2. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -type PageCreated 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 page the event relates to.""" - page: Page -} - """ Deletes a page. @@ -15973,11 +16080,6 @@ enum PermissionEnum { HANDLE_TAXES MANAGE_TAXES MANAGE_CHANNELS - MANAGE_CHECKOUTS - HANDLE_CHECKOUTS - HANDLE_TAXES - MANAGE_TAXES - MANAGE_CHANNELS MANAGE_DISCOUNTS MANAGE_GIFT_CARD MANAGE_MENUS @@ -16476,6 +16578,16 @@ type Product implements Node & ObjectWithMetadata { """A type of tax. Assigned by enabled tax gateway""" taxType: TaxType @deprecated(reason: "This field will be removed in Saleor 4.0. Use `taxClass` field instead.") + """ + Get a single attribute attached to product by attribute slug. + + Added in Saleor 3.9. + """ + attribute( + """Slug of the attribute""" + slug: String! + ): SelectedAttribute + """List of attributes assigned to this product.""" attributes: [SelectedAttribute!]! @@ -16498,13 +16610,33 @@ type Product implements Node & ObjectWithMetadata { id: ID ): ProductImage @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `mediaById` field instead.") + """ + Get a single variant by SKU or ID. + + Added in Saleor 3.9. + """ + variant( + """ID of the variant.""" + id: ID + + """SKU of the variant.""" + sku: String + ): ProductVariant + """ List of variants for the product. Requires the following permissions to include the unpublished items: MANAGE_ORDERS, MANAGE_DISCOUNTS, MANAGE_PRODUCTS. """ variants: [ProductVariant!] """List of media for the product.""" - media: [ProductMedia!] + media( + """ + Sort media. + + Added in Saleor 3.9. + """ + sortBy: MediaSortingInput + ): [ProductMedia!] """List of images for the product.""" images: [ProductImage!] @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `media` field instead.") @@ -16535,6 +16667,13 @@ type Product implements Node & ObjectWithMetadata { Requires one of the following permissions: AUTHENTICATED_STAFF_USER. """ taxClass: TaxClass + + """ + External ID of this product. + + Added in Saleor 3.10. + """ + externalReference: String } """ @@ -16861,6 +17000,13 @@ input ProductCreateInput { """ privateMetadata: [MetadataInput!] + """ + External ID of this product. + + Added in Saleor 3.10. + """ + externalReference: String + """ID of the type that product belongs to.""" productType: ID! } @@ -16895,36 +17041,6 @@ type ProductCreated implements Event { category: Category } -""" -Event sent when new product is created. - -Added in Saleor 3.2. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -type ProductCreated 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 the event relates to.""" - product( - """Slug of a channel for which the data should be returned.""" - channel: String - ): Product - - """The category of the product.""" - category: Category -} - """ Deletes a product. @@ -17179,6 +17295,13 @@ input ProductInput { Added in Saleor 3.8. """ privateMetadata: [MetadataInput!] + + """ + External ID of this product. + + Added in Saleor 3.10. + """ + externalReference: String } """Represents a product media.""" @@ -17621,13 +17744,6 @@ type ProductType implements Node & ObjectWithMetadata { """ taxClass: TaxClass - """ - Tax class assigned to this product type. All products of this product type use this tax class, unless it's overridden in the `Product` type. - - Requires one of the following permissions: MANAGE_TAXES, MANAGE_PRODUCTS, MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES. - """ - taxClass: TaxClass - """Variant attributes of that product type.""" variantAttributes( """Define scope of returned attributes.""" @@ -18040,6 +18156,13 @@ type ProductVariant implements Node & ObjectWithMetadata { preorder: PreorderData created: DateTime! updatedAt: DateTime! + + """ + External ID of this product. + + Added in Saleor 3.10. + """ + externalReference: String } """ @@ -18137,6 +18260,13 @@ input ProductVariantBulkCreateInput { """ privateMetadata: [MetadataInput!] + """ + External ID of this product variant. + + Added in Saleor 3.10. + """ + externalReference: String + """Stocks of a product available for sale.""" stocks: [StockInput!] @@ -18292,6 +18422,13 @@ input ProductVariantCreateInput { """ privateMetadata: [MetadataInput!] + """ + External ID of this product variant. + + Added in Saleor 3.10. + """ + externalReference: String + """Product ID of which type is the variant.""" product: ID! @@ -18326,33 +18463,6 @@ type ProductVariantCreated implements Event { ): ProductVariant } -""" -Event sent when new product variant is created. - -Added in Saleor 3.2. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -type ProductVariantCreated 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 -} - """ Deletes a product variant. @@ -18448,6 +18558,13 @@ input ProductVariantInput { Added in Saleor 3.8. """ privateMetadata: [MetadataInput!] + + """ + External ID of this product variant. + + Added in Saleor 3.10. + """ + externalReference: String } """ @@ -18731,8 +18848,15 @@ type Query { Requires one of the following permissions: MANAGE_PRODUCTS, MANAGE_ORDERS, MANAGE_SHIPPING. """ warehouse( - """ID of an warehouse""" - id: ID! + """ID of a warehouse.""" + id: ID + + """ + External ID of a warehouse. + + Added in Saleor 3.10. + """ + externalReference: String ): Warehouse """ @@ -19090,6 +19214,13 @@ type Query { """Slug of the product.""" slug: String + """ + External ID of the product. + + Added in Saleor 3.10. + """ + externalReference: String + """Slug of a channel for which the data should be returned.""" channel: String ): Product @@ -19157,6 +19288,13 @@ type Query { """Sku of the product variant.""" sku: String + """ + External ID of the product. + + Added in Saleor 3.10. + """ + externalReference: String + """Slug of a channel for which the data should be returned.""" channel: String ): ProductVariant @@ -19337,10 +19475,17 @@ type Query { last: Int ): OrderEventCountableConnection - """Look up an order by ID.""" + """Look up an order by ID or external reference.""" order( """ID of an order.""" - id: ID! + id: ID + + """ + External ID of an order. + + Added in Saleor 3.10. + """ + externalReference: String ): Order """ @@ -19862,13 +20007,20 @@ type Query { last: Int ): AttributeCountableConnection - """Look up an attribute by ID.""" + """Look up an attribute by ID, slug or external reference.""" attribute( """ID of the attribute.""" id: ID """Slug of the attribute.""" slug: String + + """ + External ID of the attribute. + + Added in Saleor 3.10. + """ + externalReference: String ): Attribute """ @@ -20073,6 +20225,13 @@ type Query { """Email address of the user.""" email: String + + """ + External ID of the user. + + Added in Saleor 3.10. + """ + externalReference: String ): User _entities(representations: [_Any]): [_Entity] _service: _Service @@ -21504,33 +21663,6 @@ type ShippingZoneCreated implements Event { ): ShippingZone } -""" -Event sent when new shipping zone is created. - -Added in Saleor 3.2. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -type ShippingZoneCreated 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 shipping zone the event relates to.""" - shippingZone( - """Slug of a channel for which the data should be returned.""" - channel: String - ): ShippingZone -} - """ Deletes a shipping zone. @@ -21667,33 +21799,6 @@ type ShippingZoneUpdated implements Event { ): ShippingZone } -""" -Event sent when shipping zone is updated. - -Added in Saleor 3.2. - -Note: this API is currently in Feature Preview and can be subject to changes at later point. -""" -type ShippingZoneUpdated 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 shipping zone the event relates to.""" - shippingZone( - """Slug of a channel for which the data should be returned.""" - channel: String - ): ShippingZone -} - """ Represents a shop resource containing general shop data and configuration. """ @@ -21886,6 +21991,13 @@ type Shop { """ version: String! + """ + Minor Saleor API version. + + Added in Saleor 3.5. + """ + schemaVersion: String! + """Include taxes in prices.""" includeTaxesInPrices: Boolean! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `Channel.taxConfiguration.pricesEnteredWithTax` to determine whether prices are entered with tax.") @@ -23974,6 +24086,13 @@ type User implements Node & ObjectWithMetadata { languageCode: LanguageCodeEnum! defaultShippingAddress: Address defaultBillingAddress: Address + + """ + External ID of this user. + + Added in Saleor 3.10. + """ + externalReference: String lastLogin: DateTime dateJoined: DateTime! updatedAt: DateTime! @@ -24057,6 +24176,13 @@ input UserCreateInput { """User language code.""" languageCode: LanguageCodeEnum + """ + External ID of the customer. + + Added in Saleor 3.10. + """ + externalReference: String + """ URL of a view where users should be redirected to set the password. URL in RFC 1808 format. """ @@ -24844,6 +24970,13 @@ type Warehouse implements Node & ObjectWithMetadata { """Return the last n elements from the list.""" last: Int ): ShippingZoneCountableConnection! + + """ + External ID of this warehouse. + + Added in Saleor 3.10. + """ + externalReference: String } """An enumeration.""" @@ -24888,6 +25021,13 @@ input WarehouseCreateInput { """The email address of the warehouse.""" email: String + """ + External ID of the warehouse. + + Added in Saleor 3.10. + """ + externalReference: String + """Warehouse name.""" name: String! @@ -25073,6 +25213,13 @@ input WarehouseUpdateInput { """The email address of the warehouse.""" email: String + """ + External ID of the warehouse. + + Added in Saleor 3.10. + """ + externalReference: String + """Warehouse name.""" name: String @@ -25226,7 +25373,7 @@ input WebhookCreateInput { } """ -Deletes a webhook subscription. +Delete a webhook. Before the deletion, the webhook is deactivated to pause any deliveries that are already scheduled. The deletion might fail if delivery is in progress. In such a case, the webhook is not deleted but remains deactivated. Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP. """ @@ -25236,6 +25383,38 @@ type WebhookDelete { webhook: Webhook } +""" +Performs a dry run of a webhook event. + +Requires one of the following permissions: MANAGE_APPS. +""" +type WebhookDryRun { + """JSON payload, that would be sent out to webhook's target URL.""" + payload: JSONString + errors: [WebhookDryRunError!]! +} + +type WebhookDryRunError { + """ + 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: WebhookDryRunErrorCode! +} + +"""An enumeration.""" +enum WebhookDryRunErrorCode { + GRAPHQL_ERROR + NOT_FOUND + INVALID_ID + MISSING_PERMISSION +} + type WebhookError { """ Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. @@ -25256,6 +25435,7 @@ enum WebhookErrorCode { NOT_FOUND REQUIRED UNIQUE + DELETE_FAILED } """Webhook event.""" @@ -26298,6 +26478,38 @@ enum WebhookSampleEventTypeEnum { OBSERVABILITY } +""" +Trigger a webhook event. + +Requires one of the following permissions: MANAGE_APPS. +""" +type WebhookTrigger { + delivery: EventDelivery + errors: [WebhookTriggerError!]! +} + +type WebhookTriggerError { + """ + 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: WebhookTriggerErrorCode! +} + +"""An enumeration.""" +enum WebhookTriggerErrorCode { + GRAPHQL_ERROR + NOT_FOUND + INVALID_ID + MISSING_PERMISSION + MISSING_QUERY +} + """ Updates a webhook subscription. @@ -26376,7 +26588,7 @@ enum WeightUnitsEnum { scalar _Any """_Entity union as defined by Federation spec.""" -union _Entity = App | Address | User | Group | ProductVariant | Product | ProductType | Collection | Category | ProductMedia | PageType +union _Entity = App | Address | User | Group | ProductVariant | Product | ProductType | ProductMedia | Category | Collection | PageType """_Service manifest as defined by Federation spec.""" type _Service { diff --git a/src/components/DryRun/DryRun.test.tsx b/src/components/DryRun/DryRun.test.tsx new file mode 100644 index 000000000..10f0c2715 --- /dev/null +++ b/src/components/DryRun/DryRun.test.tsx @@ -0,0 +1,42 @@ +import { MockedProvider, MockedResponse } from "@apollo/client/testing"; +import { WebhookEventTypeAsyncEnum } from "@dashboard/graphql"; +import { ThemeProvider } from "@saleor/macaw-ui"; +import productsMocks from "@test/mocks/products"; +import { render, screen } from "@testing-library/react"; +import React from "react"; + +import DryRun from "./DryRun"; + +const mocks: MockedResponse[] = [...productsMocks]; + +jest.mock("react-intl", () => ({ + useIntl: jest.fn(() => ({ + formatMessage: jest.fn(x => x.defaultMessage), + })), + defineMessages: jest.fn(x => x), +})); + +describe("DryRun", () => { + it("Dialog is available on the webhook page", async () => { + // Arrange + const props = { + query: "", + showDialog: true, + setShowDialog: jest.fn(), + asyncEvents: [] as WebhookEventTypeAsyncEnum[], + setResult: jest.fn(), + }; + + // Act + render( + + + + + , + ); + + // Assert + expect(screen.queryByTestId("dry-run")).toBeInTheDocument(); + }); +}); diff --git a/src/components/DryRun/DryRun.tsx b/src/components/DryRun/DryRun.tsx new file mode 100644 index 000000000..6f0152054 --- /dev/null +++ b/src/components/DryRun/DryRun.tsx @@ -0,0 +1,171 @@ +import Grid from "@dashboard/components/Grid"; +import { useStyles } from "@dashboard/custom-apps/components/WebhookEvents/styles"; +import { + useTriggerWebhookDryRunMutation, + WebhookEventTypeAsyncEnum, +} from "@dashboard/graphql"; +import { + capitalize, + Dialog, + DialogActions, + DialogContent, + DialogContentText, + Typography, +} from "@material-ui/core"; +import { + Alert, + Button, + DialogHeader, + List, + ListBody, + ListHeader, + ListItem, + ListItemCell, +} from "@saleor/macaw-ui"; +import React, { Dispatch, SetStateAction, useState } from "react"; +import { useIntl } from "react-intl"; + +import DryRunItemsList from "../DryRunItemsList/DryRunItemsList"; +import { messages } from "./messages"; +import { getObjects } from "./utils"; + +interface DryRunProps { + query: string; + showDialog: boolean; + setShowDialog: Dispatch>; + asyncEvents: WebhookEventTypeAsyncEnum[]; + setResult: Dispatch>; +} + +export const DryRun: React.FC = ({ + setResult, + showDialog, + setShowDialog, + query, +}: DryRunProps) => { + const intl = useIntl(); + const classes = useStyles(); + const [objectId, setObjectId] = useState(null); + const [triggerWebhookDryRun] = useTriggerWebhookDryRunMutation(); + const availableObjects = getObjects(query); + const unavailableObjects = getObjects(query, false); + + const [object, setObject] = useState(null); + + const dryRun = async () => { + const { data } = await triggerWebhookDryRun({ + variables: { objectId, query }, + }); + setResult(JSON.stringify(JSON.parse(data.webhookDryRun.payload), null, 2)); + closeDialog(); + }; + + const closeDialog = () => { + setShowDialog(false); + setObjectId(null); + setObject(null); + setShowDialog(false); + }; + + if (!showDialog) { + return <>; + } + + return ( + + + {intl.formatMessage(messages.header)} + + + + {intl.formatMessage(messages.selectObject)} + + + {!!unavailableObjects.length && ( + + + {intl.formatMessage(messages.unavailableObjects)} +   + {unavailableObjects.join(", ")} + + + )} + + +
+ + + + + {intl.formatMessage(messages.objects)} + + + + + + {!availableObjects.length && ( + + {intl.formatMessage(messages.noObjects)} + + )} + {availableObjects.map((object, idx) => ( + + setObject(object.split(" ").join("_").toUpperCase()) + } + > + + + {capitalize(object.replaceAll("_", " ").toLowerCase())} + + + + + ))} + + +
+
+ {object ? ( + + ) : ( + <> + + + + {intl.formatMessage(messages.item)} + + + + + + {intl.formatMessage(messages.itemsDefaultMessage)} + + + + )} +
+
+
+ + + +
+ ); +}; + +DryRun.displayName = "DryRun"; +export default DryRun; diff --git a/src/components/DryRun/index.ts b/src/components/DryRun/index.ts new file mode 100644 index 000000000..e8de5fd2f --- /dev/null +++ b/src/components/DryRun/index.ts @@ -0,0 +1,2 @@ +export { default } from "./DryRun"; +export * from "./DryRun"; diff --git a/src/components/DryRun/messages.ts b/src/components/DryRun/messages.ts new file mode 100644 index 000000000..b4cd41c09 --- /dev/null +++ b/src/components/DryRun/messages.ts @@ -0,0 +1,45 @@ +import { defineMessages } from "react-intl"; + +export const messages = defineMessages({ + header: { + id: "fi9Qa/", + defaultMessage: "Dry run", + description: "Dry run dialog header", + }, + selectObject: { + id: "+RffqY", + defaultMessage: "Select object type to perform dry run on provided query", + description: "Dry run dialog object title", + }, + unavailableObjects: { + id: "ApNw0L", + defaultMessage: + "The following objects are currently not available for dry run:", + description: "Dry run objects unavailable", + }, + objects: { + id: "uccjUM", + defaultMessage: "Objects", + description: "Dry run objects", + }, + noObjects: { + id: "0u9Ng0", + defaultMessage: "No objects found in the provided query", + description: "Dry run no objects found", + }, + item: { + id: "ZepEWY", + defaultMessage: "Item", + description: "Dry run item", + }, + itemsDefaultMessage: { + id: "5b0Boq", + defaultMessage: "Choose the object", + description: "Dry run items list default message", + }, + run: { + id: "48dMqY", + defaultMessage: "Run", + description: "Dry run trigger button", + }, +}); diff --git a/src/components/DryRun/mutations.ts b/src/components/DryRun/mutations.ts new file mode 100644 index 000000000..dd6eae880 --- /dev/null +++ b/src/components/DryRun/mutations.ts @@ -0,0 +1,13 @@ +import { gql } from "@apollo/client"; + +export const triggerWebhookDryRun = gql` + mutation TriggerWebhookDryRun($objectId: ID!, $query: String!) { + webhookDryRun(objectId: $objectId, query: $query) { + payload + errors { + field + message + } + } + } +`; diff --git a/src/components/DryRun/utils.ts b/src/components/DryRun/utils.ts new file mode 100644 index 000000000..993e1fc12 --- /dev/null +++ b/src/components/DryRun/utils.ts @@ -0,0 +1,59 @@ +import { AsyncWebhookTypes } from "@dashboard/custom-apps/components/WebhookEvents"; +import { InlineFragmentNode, ObjectFieldNode, parse, visit } from "graphql"; +import uniq from "lodash/uniq"; + +import { ExcludedDocumentMap } from "../DryRunItemsList/utils"; + +const getEventsFromQuery = (query: string) => { + if (query.length === 0) { + return []; + } + + try { + const ast = parse(query); + const events: string[] = []; + + visit(ast, { + SelectionSet(node, _key, parent) { + if ((parent as ObjectFieldNode).name?.value === "event") { + const queryEvents = node.selections.map( + selection => + (selection as InlineFragmentNode).typeCondition.name.value, + ); + + queryEvents.map(event => events.push(event)); + } + }, + }); + + return events; + } catch { + return []; + } +}; + +export const getObjects = (query: string, available = true) => { + const queryEvents = getEventsFromQuery(query); + + return uniq( + queryEvents.map(event => { + const object = event.split(/(?=[A-Z])/).slice(0, -1); + if ( + Object.keys(AsyncWebhookTypes) + .filter(object => + available + ? !Object.keys(ExcludedDocumentMap).includes(object.toUpperCase()) + : Object.keys(ExcludedDocumentMap).includes(object.toUpperCase()), + ) + .includes(object.join("_").toUpperCase()) + ) { + return object.join(" "); + } + + return event + .split(/(?=[A-Z])/) + .slice(0, -2) + .join(" "); + }), + ).filter(object => object.length > 0); +}; diff --git a/src/components/DryRunItemsList/DryRunItemsList.test.tsx b/src/components/DryRunItemsList/DryRunItemsList.test.tsx new file mode 100644 index 000000000..f5c3718b9 --- /dev/null +++ b/src/components/DryRunItemsList/DryRunItemsList.test.tsx @@ -0,0 +1,39 @@ +import { MockedProvider, MockedResponse } from "@apollo/client/testing"; +import { ThemeProvider } from "@saleor/macaw-ui"; +import { productsMocks } from "@test/mocks/products"; +import { render, screen } from "@testing-library/react"; +import React from "react"; + +import DryRunItemsList from "./DryRunItemsList"; + +const mocks: MockedResponse[] = [...productsMocks]; + +jest.mock("react-intl", () => ({ + useIntl: jest.fn(() => ({ + formatMessage: jest.fn(x => x.defaultMessage), + })), + defineMessages: jest.fn(x => x), +})); + +describe("DryRunItemsList", () => { + it("is available on the webhook page", async () => { + // Arrange + const props = { + objectId: null, + setObjectId: jest.fn(), + object: "PRODUCT", + }; + + // Act + render( + + + + + , + ); + + // Assert + expect(screen.queryByTestId("dry-run-items-list")).toBeInTheDocument(); + }); +}); diff --git a/src/components/DryRunItemsList/DryRunItemsList.tsx b/src/components/DryRunItemsList/DryRunItemsList.tsx new file mode 100644 index 000000000..471874ab5 --- /dev/null +++ b/src/components/DryRunItemsList/DryRunItemsList.tsx @@ -0,0 +1,106 @@ +import Skeleton from "@dashboard/components/Skeleton"; +import { useStyles } from "@dashboard/custom-apps/components/WebhookEvents/styles"; +import { useQuery } from "@dashboard/hooks/graphql"; +import { mapEdgesToItems } from "@dashboard/utils/maps"; +import { Radio } from "@material-ui/core"; +import { + List, + ListBody, + ListHeader, + ListItem, + ListItemCell, + useListWidths, +} from "@saleor/macaw-ui"; +import camelCase from "lodash/camelCase"; +import React from "react"; +import { useIntl } from "react-intl"; + +import Avatar from "../TableCellAvatar/Avatar"; +import { messages } from "./messages"; +import { DocumentMap, TData, TVariables } from "./utils"; +interface DryRunItemsListProps { + objectId: string; + setObjectId: React.Dispatch; + object: string; +} + +const DryRunItemsList = (props: DryRunItemsListProps) => { + const intl = useIntl(); + const classes = useStyles(); + const { checkbox } = useListWidths(); + const { object, objectId, setObjectId } = props; + const objectDocument = DocumentMap[object]; + const objectCollection = + objectDocument.collection ?? camelCase(`${object.toLowerCase()}s`); + + const { data, loading } = useQuery( + objectDocument.document, + { + displayLoader: true, + variables: objectDocument.variables, + }, + ); + + return ( + + + + + {intl.formatMessage(messages.item)} +   + {objectDocument.collection + ?.split(/(?=[A-Z])/) + .map(item => item.toLowerCase()) + .join(" ")} +   + {objectDocument.displayedAttribute} + + + + + {loading ? ( + + + + + + + + + + + + ) : ( + (mapEdgesToItems(data[objectCollection]) || []).map( + (item, idx) => ( + setObjectId(item.id)} + > + + {item.name || + item[objectDocument.displayedAttribute] || + item.id || + item.__typename} + + + {item.thumbnail && } + + + + + + ), + ) + )} + + + ); +}; + +DryRunItemsList.displayName = "DryRunItemsList"; +export default DryRunItemsList; diff --git a/src/components/DryRunItemsList/index.ts b/src/components/DryRunItemsList/index.ts new file mode 100644 index 000000000..b546ac159 --- /dev/null +++ b/src/components/DryRunItemsList/index.ts @@ -0,0 +1,2 @@ +export { default } from "./DryRunItemsList"; +export * from "./DryRunItemsList"; diff --git a/src/components/DryRunItemsList/messages.ts b/src/components/DryRunItemsList/messages.ts new file mode 100644 index 000000000..1863a4b32 --- /dev/null +++ b/src/components/DryRunItemsList/messages.ts @@ -0,0 +1,9 @@ +import { defineMessages } from "react-intl"; + +export const messages = defineMessages({ + item: { + id: "Xz/sDf", + defaultMessage: "Item:", + description: "Dry run items list item", + }, +}); diff --git a/src/components/DryRunItemsList/queries.ts b/src/components/DryRunItemsList/queries.ts new file mode 100644 index 000000000..da4a7abef --- /dev/null +++ b/src/components/DryRunItemsList/queries.ts @@ -0,0 +1,30 @@ +import { gql } from "@apollo/client"; + +export const checkouts = gql` + query CheckoutList($first: Int, $after: String, $last: Int, $before: String) { + checkouts(before: $before, after: $after, first: $first, last: $last) { + edges { + cursor + node { + id + created + } + } + pageInfo { + hasPreviousPage + hasNextPage + startCursor + endCursor + } + } + } +`; + +export const channels = gql` + query ChannelList { + channels { + id + name + } + } +`; diff --git a/src/components/DryRunItemsList/utils.ts b/src/components/DryRunItemsList/utils.ts new file mode 100644 index 000000000..7be28c704 --- /dev/null +++ b/src/components/DryRunItemsList/utils.ts @@ -0,0 +1,262 @@ +import { + AppsListDocument, + AppsListQuery, + AppsListQueryVariables, + AttributeListDocument, + AttributeListQuery, + AttributeListQueryVariables, + CategoryDetailsQuery, + CategoryDetailsQueryVariables, + ChannelListDocument, + CheckoutListDocument, + CheckoutListQuery, + CheckoutListQueryVariables, + CollectionListDocument, + CollectionListQuery, + CollectionListQueryVariables, + CustomerAddressesDocument, + CustomerAddressesQuery, + CustomerAddressesQueryVariables, + CustomerDetailsQuery, + CustomerDetailsQueryVariables, + GiftCardListDocument, + GiftCardListQuery, + GiftCardListQueryVariables, + ListCustomersDocument, + ListCustomersQuery, + ListCustomersQueryVariables, + MenuListDocument, + MenuListQuery, + MenuListQueryVariables, + OrderFulfillDataDocument, + OrderFulfillDataQuery, + OrderFulfillDataQueryVariables, + OrderListDocument, + OrderListQuery, + OrderListQueryVariables, + PageListDocument, + PageListQuery, + PageListQueryVariables, + ProductListDocument, + ProductListQuery, + ProductListQueryVariables, + ProductVariantListDocument, + ProductVariantListQuery, + ProductVariantListQueryVariables, + RootCategoriesDocument, + RootCategoriesQuery, + RootCategoriesQueryVariables, + SaleListDocument, + SaleListQuery, + SaleListQueryVariables, + ShippingZonesDocument, + StaffListDocument, + StaffListQuery, + StaffListQueryVariables, + VoucherListDocument, + VoucherListQuery, + VoucherListQueryVariables, + WarehouseListDocument, + WarehouseListQuery, + WarehouseListQueryVariables, +} from "@dashboard/graphql"; +import { DocumentNode } from "graphql"; + +const DefaultVariables = { + first: 100, +}; + +export type TData = + | ProductListQuery + | OrderListQuery + | GiftCardListQuery + | CustomerAddressesQuery + | AppsListQuery + | AttributeListQuery + | CategoryDetailsQuery + | CheckoutListQuery + | GiftCardListQuery + | CollectionListQuery + | CustomerDetailsQuery + | OrderFulfillDataQuery + | ListCustomersQuery + | MenuListQuery + | OrderListQuery + | PageListQuery + | ProductListQuery + | ProductVariantListQuery + | RootCategoriesQuery + | SaleListQuery + | StaffListQuery + | VoucherListQuery + | WarehouseListQuery; + +export type TVariables = + | ProductListQueryVariables + | OrderListQueryVariables + | GiftCardListQueryVariables + | CustomerAddressesQueryVariables + | AppsListQueryVariables + | AttributeListQueryVariables + | CategoryDetailsQueryVariables + | ListCustomersQueryVariables + | CheckoutListQueryVariables + | GiftCardListQueryVariables + | CollectionListQueryVariables + | CustomerDetailsQueryVariables + | OrderFulfillDataQueryVariables + | MenuListQueryVariables + | OrderListQueryVariables + | PageListQueryVariables + | ProductListQueryVariables + | ProductVariantListQueryVariables + | RootCategoriesQueryVariables + | SaleListQueryVariables + | StaffListQueryVariables + | VoucherListQueryVariables + | WarehouseListQueryVariables; + +interface Document { + document: DocumentNode; + variables: TVariables; + collection?: string; + displayedAttribute?: string; +} + +export const DocumentMap: Record = { + APP: { + document: AppsListDocument, + variables: DefaultVariables, + displayedAttribute: "name", + }, + ATTRIBUTE: { + document: AttributeListDocument, + variables: DefaultVariables, + displayedAttribute: "name", + }, + CATEGORY: { + document: RootCategoriesDocument, + variables: DefaultVariables, + collection: "categories", + displayedAttribute: "name", + }, + GIFT_CARD: { + document: GiftCardListDocument, + variables: DefaultVariables, + displayedAttribute: "last4CodeChars", + }, + CHECKOUT: { + document: CheckoutListDocument, + variables: DefaultVariables, + displayedAttribute: "id", + }, + COLLECTION: { + document: CollectionListDocument, + variables: DefaultVariables, + displayedAttribute: "name", + }, + CUSTOMER: { + document: ListCustomersDocument, + variables: DefaultVariables, + displayedAttribute: "email", + // TODO inverted name + }, + + INVOICE: { + document: OrderListDocument, + variables: DefaultVariables, + collection: "orders", + displayedAttribute: "number", + }, + MENU: { + document: MenuListDocument, + variables: DefaultVariables, + displayedAttribute: "name", + }, + ORDER: { + document: OrderListDocument, + variables: DefaultVariables, + displayedAttribute: "number", + }, + PAGE: { + document: PageListDocument, + variables: DefaultVariables, + displayedAttribute: "title", + }, + PRODUCT: { + document: ProductListDocument, + variables: { + first: 100, + hasChannel: true, + hasSelectedAttributes: true, + }, + displayedAttribute: "name", + }, + SALE: { + document: SaleListDocument, + variables: DefaultVariables, + displayedAttribute: "name", + }, + SHIPPING_PRICE: { + document: ShippingZonesDocument, + variables: DefaultVariables, + collection: "shippingZones", + displayedAttribute: "name", + }, + SHIPPING_ZONE: { + document: ShippingZonesDocument, + variables: DefaultVariables, + displayedAttribute: "name", + }, + STAFF: { + document: StaffListDocument, + variables: DefaultVariables, + collection: "staffUsers", + displayedAttribute: "email", + }, + VOUCHER: { + document: VoucherListDocument, + variables: DefaultVariables, + displayedAttribute: "code", + }, + WAREHOUSE: { + document: WarehouseListDocument, + variables: DefaultVariables, + displayedAttribute: "name", + }, +}; + +// Documents which require parent object or can't be handled ATM +// +export const ExcludedDocumentMap: Record = { + ADDRESS: { + document: CustomerAddressesDocument, + variables: { + // USER ID REQUIRED + first: 100, + }, + }, + // it's not a countable collection + CHANNEL: { + document: ChannelListDocument, + variables: {}, + }, + FULFILLMENT: { + document: OrderFulfillDataDocument, + variables: { + // ORDER ID REQUIRED + first: 100, + }, + }, + PRODUCT_VARIANT: { + document: ProductVariantListDocument, + variables: { + // PRODUCT ID REQUIRED + first: 100, + }, + }, + TRANSLATION: { + document: null, + variables: {}, + }, +}; diff --git a/src/components/GraphiQL/GraphiQL.tsx b/src/components/GraphiQL/GraphiQL.tsx index 36d2ae602..52ff1b3cc 100644 --- a/src/components/GraphiQL/GraphiQL.tsx +++ b/src/components/GraphiQL/GraphiQL.tsx @@ -1,7 +1,9 @@ +import { WebhookEventTypeAsyncEnum } from "@dashboard/graphql"; import { CopyIcon, GraphiQLProvider, GraphiQLProviderProps, + PlayIcon, PrettifyIcon, QueryEditor, ToolbarButton, @@ -18,8 +20,16 @@ import { WriteableEditorProps, } from "@graphiql/react"; import clsx from "clsx"; -import React, { ComponentType, PropsWithChildren, ReactNode } from "react"; +import React, { + ComponentType, + PropsWithChildren, + ReactNode, + useState, +} from "react"; +import { useIntl } from "react-intl"; +import DryRun from "../DryRun"; +import { messages } from "./messages"; import { useDashboardTheme, useEditorStyles, @@ -68,7 +78,7 @@ export function GraphiQL({ visiblePlugin, defaultHeaders, ...props -}: GraphiQLProps) { +}: GraphiQLProps & { asyncEvents: WebhookEventTypeAsyncEnum[] }) { // Ensure props are correct if (typeof fetcher !== "function") { throw new TypeError( @@ -76,6 +86,9 @@ export function GraphiQL({ ); } + const [showDialog, setShowDialog] = useState(false); + const [result, setResult] = useState(""); + return ( - + + ); } @@ -127,9 +152,13 @@ export type GraphiQLInterfaceProps = WriteableEditorProps & defaultEditorToolsVisibility?: boolean | "variables" | "headers"; isHeadersEditorEnabled?: boolean; toolbar?: GraphiQLToolbarConfig; + showDialog?: boolean; + setShowDialog?: React.Dispatch>; + result?: string; }; export function GraphiQLInterface(props: GraphiQLInterfaceProps) { + const intl = useIntl(); const editorContext = useEditorContext({ nonNull: true }); const pluginContext = usePluginContext(); @@ -150,6 +179,13 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) { isChildComponentType(child, GraphiQL.Toolbar), ) || ( <> + props.setShowDialog(true)} + label={intl.formatMessage(messages.toolbarButonLabel)} + > + + prettify()} label="Prettify query (Shift-Ctrl-P)" @@ -266,6 +302,14 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) { +
+
+
+
+
+
{props.result}
+
+
diff --git a/src/components/GraphiQL/messages.ts b/src/components/GraphiQL/messages.ts new file mode 100644 index 000000000..68926abe7 --- /dev/null +++ b/src/components/GraphiQL/messages.ts @@ -0,0 +1,9 @@ +import { defineMessages } from "react-intl"; + +export const messages = defineMessages({ + toolbarButonLabel: { + id: "Q2us5X", + defaultMessage: "Dry run", + description: "Dry run icon label", + }, +}); diff --git a/src/components/GraphiQL/styles.ts b/src/components/GraphiQL/styles.ts index 81db9cd88..aff649541 100644 --- a/src/components/GraphiQL/styles.ts +++ b/src/components/GraphiQL/styles.ts @@ -8,6 +8,9 @@ import { useEffect } from "react"; export const useStyles = makeStyles( () => ({ + pre: { + whiteSpace: "break-spaces", + }, scrollable: { // Overrides inline styling which breaks scroll // on doc explorer plugin diff --git a/src/custom-apps/components/WebhookEvents/WebhookEvents.tsx b/src/custom-apps/components/WebhookEvents/WebhookEvents.tsx index e5e3c8524..0f1678144 100644 --- a/src/custom-apps/components/WebhookEvents/WebhookEvents.tsx +++ b/src/custom-apps/components/WebhookEvents/WebhookEvents.tsx @@ -9,6 +9,7 @@ import { capitalize } from "@dashboard/misc"; import { Card, CardContent, Checkbox, Typography } from "@material-ui/core"; import { List, + ListBody, ListHeader, ListItem, ListItemCell, @@ -105,7 +106,7 @@ const WebhookEvents: React.FC = ({ -
+ {Object.keys(EventTypes[tab]).map((object, idx) => ( = ({ ))} -
+ @@ -143,28 +144,30 @@ const WebhookEvents: React.FC = ({ - {object && - EventTypes[tab][object] && - EventTypes[tab][object].map((event, idx) => ( - - - - {capitalize(event.toLowerCase().replaceAll("_", " "))} - - - - - - - ))} + + {object && + EventTypes[tab][object] && + EventTypes[tab][object].map((event, idx) => ( + + + + {capitalize(event.toLowerCase().replaceAll("_", " "))} + + + + + + + ))} + @@ -177,7 +180,7 @@ export default WebhookEvents; type Actions = string[]; -const AsyncWebhookTypes: Record = { +export const AsyncWebhookTypes: Record = { ADDRESS: ["CREATED", "UPDATED", "DELETED"], APP: ["INSTALLED", "UPDATED", "DELETED"], ATTRIBUTE: ["CREATED", "UPDATED", "DELETED"], diff --git a/src/custom-apps/components/WebhookEvents/styles.ts b/src/custom-apps/components/WebhookEvents/styles.ts index c4862173e..9e52692a9 100644 --- a/src/custom-apps/components/WebhookEvents/styles.ts +++ b/src/custom-apps/components/WebhookEvents/styles.ts @@ -3,7 +3,6 @@ import { makeStyles } from "@saleor/macaw-ui"; export const useStyles = makeStyles( theme => ({ eventsWrapper: { - overflow: "scroll", padding: theme.spacing(4), paddingLeft: 0, }, @@ -17,6 +16,10 @@ export const useStyles = makeStyles( padding: theme.spacing(1), minHeight: 0, }, + listBody: { + height: 300, + overflow: "scroll", + }, listItem: { minHeight: 0, gap: 0, @@ -24,10 +27,7 @@ export const useStyles = makeStyles( }, listItemCell: { paddingLeft: "0 !important", - }, - listItems: { - height: 300, - overflow: "scroll", + wordBreak: "break-all", }, checkbox: { padding: 0, diff --git a/src/custom-apps/components/WebhookSubscriptionQuery/WebhookSubscriptionQuery.test.tsx b/src/custom-apps/components/WebhookSubscriptionQuery/WebhookSubscriptionQuery.test.tsx index 640cbde8b..8bf7cacaf 100644 --- a/src/custom-apps/components/WebhookSubscriptionQuery/WebhookSubscriptionQuery.test.tsx +++ b/src/custom-apps/components/WebhookSubscriptionQuery/WebhookSubscriptionQuery.test.tsx @@ -5,6 +5,7 @@ import { WebhookEventTypeSyncEnum, } from "@dashboard/graphql"; import { Fetcher } from "@graphiql/toolkit"; +import { ApolloMockedProvider } from "@test/ApolloMockedProvider"; import { render, screen } from "@testing-library/react"; import React from "react"; @@ -51,7 +52,11 @@ describe("WebhookSubscriptionQuery", () => { // const user = userEvent.setup(); // Act - render(); + render( + + + , + ); // Assert expect(screen.queryByTestId("graphiql-container")).toBeInTheDocument(); diff --git a/src/custom-apps/components/WebhookSubscriptionQuery/WebhookSubscriptionQuery.tsx b/src/custom-apps/components/WebhookSubscriptionQuery/WebhookSubscriptionQuery.tsx index 2e7b3dc8f..6c2e24aea 100644 --- a/src/custom-apps/components/WebhookSubscriptionQuery/WebhookSubscriptionQuery.tsx +++ b/src/custom-apps/components/WebhookSubscriptionQuery/WebhookSubscriptionQuery.tsx @@ -59,6 +59,7 @@ const WebhookSubscriptionQuery: React.FC = ({ onEditQuery={setQuery} plugins={[explorerPlugin]} isHeadersEditorEnabled={false} + asyncEvents={data.asyncEvents} /> diff --git a/src/custom-apps/utils.test.ts b/src/custom-apps/utils.test.ts index 3a8db0624..87def3350 100644 --- a/src/custom-apps/utils.test.ts +++ b/src/custom-apps/utils.test.ts @@ -1,88 +1,6 @@ -import { MultiAutocompleteChoiceType } from "@dashboard/components/MultiAutocompleteSelectField"; import { WebhookEventTypeAsyncEnum } from "@dashboard/graphql"; -import { filterSelectedAsyncEvents, mapAsyncEventsToChoices } from "./utils"; - -describe("Custom Apps mapping events", () => { - it("should return enabled async events choices when not any event selected", () => { - // Arrange - const events: WebhookEventTypeAsyncEnum[] = [ - WebhookEventTypeAsyncEnum.ANY_EVENTS, - WebhookEventTypeAsyncEnum.PAGE_CREATED, - WebhookEventTypeAsyncEnum.PRODUCT_CREATED, - ]; - const selectedEvents: WebhookEventTypeAsyncEnum[] = [ - WebhookEventTypeAsyncEnum.PAGE_CREATED, - ]; - - // Act - const asyncEvents = mapAsyncEventsToChoices(events, selectedEvents); - - // Assert - const expectedAsyncEvents: MultiAutocompleteChoiceType[] = [ - { - label: WebhookEventTypeAsyncEnum.ANY_EVENTS, - value: WebhookEventTypeAsyncEnum.ANY_EVENTS, - badge: undefined, - disabled: false, - }, - { - label: WebhookEventTypeAsyncEnum.PAGE_CREATED, - value: WebhookEventTypeAsyncEnum.PAGE_CREATED, - badge: undefined, - disabled: false, - }, - { - label: WebhookEventTypeAsyncEnum.PRODUCT_CREATED, - value: WebhookEventTypeAsyncEnum.PRODUCT_CREATED, - badge: undefined, - disabled: false, - }, - ]; - expect(asyncEvents).toHaveLength(3); - expect(asyncEvents).toEqual(expectedAsyncEvents); - }); - - it("should return disabled async events choices when any event selected", () => { - // Arrange - const events: WebhookEventTypeAsyncEnum[] = [ - WebhookEventTypeAsyncEnum.ANY_EVENTS, - WebhookEventTypeAsyncEnum.PAGE_CREATED, - WebhookEventTypeAsyncEnum.PRODUCT_CREATED, - ]; - const selectedEvents: WebhookEventTypeAsyncEnum[] = [ - WebhookEventTypeAsyncEnum.ANY_EVENTS, - WebhookEventTypeAsyncEnum.PAGE_CREATED, - ]; - - // Act - const asyncEvents = mapAsyncEventsToChoices(events, selectedEvents); - - // Assert - const expectedAsyncEvents: MultiAutocompleteChoiceType[] = [ - { - label: WebhookEventTypeAsyncEnum.ANY_EVENTS, - value: WebhookEventTypeAsyncEnum.ANY_EVENTS, - badge: undefined, - disabled: false, - }, - { - label: WebhookEventTypeAsyncEnum.PAGE_CREATED, - value: WebhookEventTypeAsyncEnum.PAGE_CREATED, - badge: undefined, - disabled: true, - }, - { - label: WebhookEventTypeAsyncEnum.PRODUCT_CREATED, - value: WebhookEventTypeAsyncEnum.PRODUCT_CREATED, - badge: undefined, - disabled: true, - }, - ]; - expect(asyncEvents).toHaveLength(3); - expect(asyncEvents).toEqual(expectedAsyncEvents); - }); -}); +import { filterSelectedAsyncEvents } from "./utils"; describe("Custom Apps filtering events", () => { it("should return selected async event types when not any event selected", () => { diff --git a/src/custom-apps/utils.tsx b/src/custom-apps/utils.tsx index 2d4e84fb9..cd5946786 100644 --- a/src/custom-apps/utils.tsx +++ b/src/custom-apps/utils.tsx @@ -1,71 +1,9 @@ -import { MultiAutocompleteChoiceType } from "@dashboard/components/MultiAutocompleteSelectField"; -import PreviewPill from "@dashboard/components/PreviewPill"; -import { - WebhookEventTypeAsyncEnum, - WebhookEventTypeSyncEnum, - WebhookFragment, -} from "@dashboard/graphql"; -import React from "react"; +import { WebhookEventTypeAsyncEnum, WebhookFragment } from "@dashboard/graphql"; export function isUnnamed(webhook: WebhookFragment | undefined): boolean { return !webhook?.name; } -type WebhookEventType = WebhookEventTypeSyncEnum | WebhookEventTypeAsyncEnum; - -const isWebhookInPreview = (webhook: WebhookEventType) => - ( - [ - WebhookEventTypeSyncEnum.CHECKOUT_CALCULATE_TAXES, - WebhookEventTypeSyncEnum.ORDER_CALCULATE_TAXES, - ] as WebhookEventType[] - ).includes(webhook); - -const isAsyncWebhookInPreview = (webhook: WebhookEventType) => - ( - [ - WebhookEventTypeAsyncEnum.GIFT_CARD_METADATA_UPDATED, - WebhookEventTypeAsyncEnum.ORDER_METADATA_UPDATED, - WebhookEventTypeAsyncEnum.CUSTOMER_METADATA_UPDATED, - WebhookEventTypeAsyncEnum.COLLECTION_METADATA_UPDATED, - WebhookEventTypeAsyncEnum.PRODUCT_METADATA_UPDATED, - WebhookEventTypeAsyncEnum.PRODUCT_VARIANT_METADATA_UPDATED, - WebhookEventTypeAsyncEnum.CHECKOUT_METADATA_UPDATED, - WebhookEventTypeAsyncEnum.FULFILLMENT_METADATA_UPDATED, - WebhookEventTypeAsyncEnum.SHIPPING_ZONE_METADATA_UPDATED, - WebhookEventTypeAsyncEnum.TRANSACTION_ITEM_METADATA_UPDATED, - WebhookEventTypeAsyncEnum.WAREHOUSE_METADATA_UPDATED, - WebhookEventTypeAsyncEnum.VOUCHER_METADATA_UPDATED, - ] as WebhookEventType[] - ).includes(webhook); - -export function mapSyncEventsToChoices( - events: WebhookEventTypeSyncEnum[], -): MultiAutocompleteChoiceType[] { - return events.map(event => ({ - label: event, - value: event, - badge: isWebhookInPreview(event) ? : undefined, - })); -} - -export function mapAsyncEventsToChoices( - events: WebhookEventTypeAsyncEnum[], - selectedEvents: WebhookEventTypeAsyncEnum[], -): MultiAutocompleteChoiceType[] { - const isAnyAsyncEventSelected = selectedEvents.includes( - WebhookEventTypeAsyncEnum.ANY_EVENTS, - ); - - return events.map(event => ({ - label: event, - value: event, - badge: isAsyncWebhookInPreview(event) ? : undefined, - disabled: - event !== WebhookEventTypeAsyncEnum.ANY_EVENTS && isAnyAsyncEventSelected, - })); -} - export const filterSelectedAsyncEvents = ( asyncEvents: WebhookEventTypeAsyncEnum[], ) => { diff --git a/src/graphql/fragmentTypes.generated.ts b/src/graphql/fragmentTypes.generated.ts index 00f27b516..8e207f1a4 100644 --- a/src/graphql/fragmentTypes.generated.ts +++ b/src/graphql/fragmentTypes.generated.ts @@ -297,9 +297,9 @@ "ProductVariant", "Product", "ProductType", - "Collection", - "Category", "ProductMedia", + "Category", + "Collection", "PageType" ] } diff --git a/src/graphql/hooks.generated.ts b/src/graphql/hooks.generated.ts index 3dae5ce63..1178b883f 100644 --- a/src/graphql/hooks.generated.ts +++ b/src/graphql/hooks.generated.ts @@ -5095,6 +5095,129 @@ export function useAddressValidationRulesLazyQuery(baseOptions?: ApolloReactHook export type AddressValidationRulesQueryHookResult = ReturnType; export type AddressValidationRulesLazyQueryHookResult = ReturnType; export type AddressValidationRulesQueryResult = Apollo.QueryResult; +export const TriggerWebhookDryRunDocument = gql` + mutation TriggerWebhookDryRun($objectId: ID!, $query: String!) { + webhookDryRun(objectId: $objectId, query: $query) { + payload + errors { + field + message + } + } +} + `; +export type TriggerWebhookDryRunMutationFn = Apollo.MutationFunction; + +/** + * __useTriggerWebhookDryRunMutation__ + * + * To run a mutation, you first call `useTriggerWebhookDryRunMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useTriggerWebhookDryRunMutation` 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 [triggerWebhookDryRunMutation, { data, loading, error }] = useTriggerWebhookDryRunMutation({ + * variables: { + * objectId: // value for 'objectId' + * query: // value for 'query' + * }, + * }); + */ +export function useTriggerWebhookDryRunMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useMutation(TriggerWebhookDryRunDocument, options); + } +export type TriggerWebhookDryRunMutationHookResult = ReturnType; +export type TriggerWebhookDryRunMutationResult = Apollo.MutationResult; +export type TriggerWebhookDryRunMutationOptions = Apollo.BaseMutationOptions; +export const CheckoutListDocument = gql` + query CheckoutList($first: Int, $after: String, $last: Int, $before: String) { + checkouts(before: $before, after: $after, first: $first, last: $last) { + edges { + cursor + node { + id + created + } + } + pageInfo { + hasPreviousPage + hasNextPage + startCursor + endCursor + } + } +} + `; + +/** + * __useCheckoutListQuery__ + * + * To run a query within a React component, call `useCheckoutListQuery` and pass it any options that fit your needs. + * When your component renders, `useCheckoutListQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useCheckoutListQuery({ + * variables: { + * first: // value for 'first' + * after: // value for 'after' + * last: // value for 'last' + * before: // value for 'before' + * }, + * }); + */ +export function useCheckoutListQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useQuery(CheckoutListDocument, options); + } +export function useCheckoutListLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useLazyQuery(CheckoutListDocument, options); + } +export type CheckoutListQueryHookResult = ReturnType; +export type CheckoutListLazyQueryHookResult = ReturnType; +export type CheckoutListQueryResult = Apollo.QueryResult; +export const ChannelListDocument = gql` + query ChannelList { + channels { + id + name + } +} + `; + +/** + * __useChannelListQuery__ + * + * To run a query within a React component, call `useChannelListQuery` and pass it any options that fit your needs. + * When your component renders, `useChannelListQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useChannelListQuery({ + * variables: { + * }, + * }); + */ +export function useChannelListQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useQuery(ChannelListDocument, options); + } +export function useChannelListLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return ApolloReactHooks.useLazyQuery(ChannelListDocument, options); + } +export type ChannelListQueryHookResult = ReturnType; +export type ChannelListLazyQueryHookResult = ReturnType; +export type ChannelListQueryResult = Apollo.QueryResult; export const CheckIfOrderExistsDocument = gql` query CheckIfOrderExists($id: ID!) { order(id: $id) { diff --git a/src/graphql/typePolicies.generated.ts b/src/graphql/typePolicies.generated.ts index 2a2d58ebb..ad6f5e23d 100644 --- a/src/graphql/typePolicies.generated.ts +++ b/src/graphql/typePolicies.generated.ts @@ -369,7 +369,7 @@ export type AssignedVariantAttributeFieldPolicy = { attribute?: FieldPolicy | FieldReadFunction, variantSelection?: FieldPolicy | FieldReadFunction }; -export type AttributeKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'inputType' | 'entityType' | 'name' | 'slug' | 'type' | 'unit' | 'choices' | 'valueRequired' | 'visibleInStorefront' | 'filterableInStorefront' | 'filterableInDashboard' | 'availableInGrid' | 'storefrontSearchPosition' | 'translation' | 'withChoices' | 'productTypes' | 'productVariantTypes' | AttributeKeySpecifier)[]; +export type AttributeKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'inputType' | 'entityType' | 'name' | 'slug' | 'type' | 'unit' | 'choices' | 'valueRequired' | 'visibleInStorefront' | 'filterableInStorefront' | 'filterableInDashboard' | 'availableInGrid' | 'storefrontSearchPosition' | 'translation' | 'withChoices' | 'productTypes' | 'productVariantTypes' | 'externalReference' | AttributeKeySpecifier)[]; export type AttributeFieldPolicy = { id?: FieldPolicy | FieldReadFunction, privateMetadata?: FieldPolicy | FieldReadFunction, @@ -394,7 +394,8 @@ export type AttributeFieldPolicy = { translation?: FieldPolicy | FieldReadFunction, withChoices?: FieldPolicy | FieldReadFunction, productTypes?: FieldPolicy | FieldReadFunction, - productVariantTypes?: FieldPolicy | FieldReadFunction + productVariantTypes?: FieldPolicy | FieldReadFunction, + externalReference?: FieldPolicy | FieldReadFunction }; export type AttributeBulkDeleteKeySpecifier = ('count' | 'attributeErrors' | 'errors' | AttributeBulkDeleteKeySpecifier)[]; export type AttributeBulkDeleteFieldPolicy = { @@ -486,7 +487,7 @@ export type AttributeUpdatedFieldPolicy = { recipient?: FieldPolicy | FieldReadFunction, attribute?: FieldPolicy | FieldReadFunction }; -export type AttributeValueKeySpecifier = ('id' | 'name' | 'slug' | 'value' | 'translation' | 'inputType' | 'reference' | 'file' | 'richText' | 'plainText' | 'boolean' | 'date' | 'dateTime' | AttributeValueKeySpecifier)[]; +export type AttributeValueKeySpecifier = ('id' | 'name' | 'slug' | 'value' | 'translation' | 'inputType' | 'reference' | 'file' | 'richText' | 'plainText' | 'boolean' | 'date' | 'dateTime' | 'externalReference' | AttributeValueKeySpecifier)[]; export type AttributeValueFieldPolicy = { id?: FieldPolicy | FieldReadFunction, name?: FieldPolicy | FieldReadFunction, @@ -500,7 +501,8 @@ export type AttributeValueFieldPolicy = { plainText?: FieldPolicy | FieldReadFunction, boolean?: FieldPolicy | FieldReadFunction, date?: FieldPolicy | FieldReadFunction, - dateTime?: FieldPolicy | FieldReadFunction + dateTime?: FieldPolicy | FieldReadFunction, + externalReference?: FieldPolicy | FieldReadFunction }; export type AttributeValueBulkDeleteKeySpecifier = ('count' | 'attributeErrors' | 'errors' | AttributeValueBulkDeleteKeySpecifier)[]; export type AttributeValueBulkDeleteFieldPolicy = { @@ -549,15 +551,15 @@ export type AttributeValueDeletedFieldPolicy = { recipient?: FieldPolicy | FieldReadFunction, attributeValue?: FieldPolicy | FieldReadFunction }; -export type AttributeValueTranslatableContentKeySpecifier = ('id' | 'name' | 'richText' | 'plainText' | 'translation' | 'attribute' | 'attributeValue' | AttributeValueTranslatableContentKeySpecifier)[]; +export type AttributeValueTranslatableContentKeySpecifier = ('id' | 'name' | 'richText' | 'plainText' | 'translation' | 'attributeValue' | 'attribute' | AttributeValueTranslatableContentKeySpecifier)[]; export type AttributeValueTranslatableContentFieldPolicy = { id?: FieldPolicy | FieldReadFunction, name?: FieldPolicy | FieldReadFunction, richText?: FieldPolicy | FieldReadFunction, plainText?: FieldPolicy | FieldReadFunction, translation?: FieldPolicy | FieldReadFunction, - attribute?: FieldPolicy | FieldReadFunction, - attributeValue?: FieldPolicy | FieldReadFunction + attributeValue?: FieldPolicy | FieldReadFunction, + attribute?: FieldPolicy | FieldReadFunction }; export type AttributeValueTranslateKeySpecifier = ('translationErrors' | 'errors' | 'attributeValue' | AttributeValueTranslateKeySpecifier)[]; export type AttributeValueTranslateFieldPolicy = { @@ -2300,12 +2302,14 @@ export type MoneyRangeFieldPolicy = { start?: FieldPolicy | FieldReadFunction, stop?: FieldPolicy | FieldReadFunction }; -export type MutationKeySpecifier = ('webhookCreate' | 'webhookDelete' | 'webhookUpdate' | 'eventDeliveryRetry' | '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' | '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, webhookUpdate?: FieldPolicy | FieldReadFunction, eventDeliveryRetry?: FieldPolicy | FieldReadFunction, + webhookDryRun?: FieldPolicy | FieldReadFunction, + webhookTrigger?: FieldPolicy | FieldReadFunction, createWarehouse?: FieldPolicy | FieldReadFunction, updateWarehouse?: FieldPolicy | FieldReadFunction, deleteWarehouse?: FieldPolicy | FieldReadFunction, @@ -2601,7 +2605,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' | 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' | OrderKeySpecifier)[]; export type OrderFieldPolicy = { id?: FieldPolicy | FieldReadFunction, privateMetadata?: FieldPolicy | FieldReadFunction, @@ -2670,7 +2674,8 @@ export type OrderFieldPolicy = { translatedDiscountName?: FieldPolicy | FieldReadFunction, discounts?: FieldPolicy | FieldReadFunction, errors?: FieldPolicy | FieldReadFunction, - displayGrossPrices?: FieldPolicy | FieldReadFunction + displayGrossPrices?: FieldPolicy | FieldReadFunction, + externalReference?: FieldPolicy | FieldReadFunction }; export type OrderAddNoteKeySpecifier = ('order' | 'event' | 'orderErrors' | 'errors' | OrderAddNoteKeySpecifier)[]; export type OrderAddNoteFieldPolicy = { @@ -3501,7 +3506,7 @@ export type PreorderThresholdFieldPolicy = { quantity?: FieldPolicy | FieldReadFunction, soldUnits?: FieldPolicy | FieldReadFunction }; -export type ProductKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'seoTitle' | 'seoDescription' | 'name' | 'description' | 'productType' | 'slug' | 'category' | 'created' | 'updatedAt' | 'chargeTaxes' | 'weight' | 'defaultVariant' | 'rating' | 'channel' | 'descriptionJson' | 'thumbnail' | 'pricing' | 'isAvailable' | 'taxType' | 'attributes' | 'channelListings' | 'mediaById' | 'imageById' | 'variants' | 'media' | 'images' | 'collections' | 'translation' | 'availableForPurchase' | 'availableForPurchaseAt' | 'isAvailableForPurchase' | 'taxClass' | ProductKeySpecifier)[]; +export type ProductKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'seoTitle' | 'seoDescription' | 'name' | 'description' | 'productType' | 'slug' | 'category' | 'created' | 'updatedAt' | 'chargeTaxes' | 'weight' | 'defaultVariant' | 'rating' | 'channel' | 'descriptionJson' | 'thumbnail' | 'pricing' | 'isAvailable' | 'taxType' | 'attribute' | 'attributes' | 'channelListings' | 'mediaById' | 'imageById' | 'variant' | 'variants' | 'media' | 'images' | 'collections' | 'translation' | 'availableForPurchase' | 'availableForPurchaseAt' | 'isAvailableForPurchase' | 'taxClass' | 'externalReference' | ProductKeySpecifier)[]; export type ProductFieldPolicy = { id?: FieldPolicy | FieldReadFunction, privateMetadata?: FieldPolicy | FieldReadFunction, @@ -3529,10 +3534,12 @@ export type ProductFieldPolicy = { pricing?: FieldPolicy | FieldReadFunction, isAvailable?: FieldPolicy | FieldReadFunction, taxType?: FieldPolicy | FieldReadFunction, + attribute?: FieldPolicy | FieldReadFunction, attributes?: FieldPolicy | FieldReadFunction, channelListings?: FieldPolicy | FieldReadFunction, mediaById?: FieldPolicy | FieldReadFunction, imageById?: FieldPolicy | FieldReadFunction, + variant?: FieldPolicy | FieldReadFunction, variants?: FieldPolicy | FieldReadFunction, media?: FieldPolicy | FieldReadFunction, images?: FieldPolicy | FieldReadFunction, @@ -3541,7 +3548,8 @@ export type ProductFieldPolicy = { availableForPurchase?: FieldPolicy | FieldReadFunction, availableForPurchaseAt?: FieldPolicy | FieldReadFunction, isAvailableForPurchase?: FieldPolicy | FieldReadFunction, - taxClass?: FieldPolicy | FieldReadFunction + taxClass?: FieldPolicy | FieldReadFunction, + externalReference?: FieldPolicy | FieldReadFunction }; export type ProductAttributeAssignKeySpecifier = ('productType' | 'productErrors' | 'errors' | ProductAttributeAssignKeySpecifier)[]; export type ProductAttributeAssignFieldPolicy = { @@ -3831,7 +3839,7 @@ export type ProductUpdatedFieldPolicy = { product?: FieldPolicy | FieldReadFunction, category?: FieldPolicy | FieldReadFunction }; -export type ProductVariantKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'name' | 'sku' | 'product' | 'trackInventory' | 'quantityLimitPerCustomer' | 'weight' | 'channel' | 'channelListings' | 'pricing' | 'attributes' | 'margin' | 'quantityOrdered' | 'revenue' | 'images' | 'media' | 'translation' | 'digitalContent' | 'stocks' | 'quantityAvailable' | 'preorder' | 'created' | 'updatedAt' | ProductVariantKeySpecifier)[]; +export type ProductVariantKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'name' | 'sku' | 'product' | 'trackInventory' | 'quantityLimitPerCustomer' | 'weight' | 'channel' | 'channelListings' | 'pricing' | 'attributes' | 'margin' | 'quantityOrdered' | 'revenue' | 'images' | 'media' | 'translation' | 'digitalContent' | 'stocks' | 'quantityAvailable' | 'preorder' | 'created' | 'updatedAt' | 'externalReference' | ProductVariantKeySpecifier)[]; export type ProductVariantFieldPolicy = { id?: FieldPolicy | FieldReadFunction, privateMetadata?: FieldPolicy | FieldReadFunction, @@ -3861,7 +3869,8 @@ export type ProductVariantFieldPolicy = { quantityAvailable?: FieldPolicy | FieldReadFunction, preorder?: FieldPolicy | FieldReadFunction, created?: FieldPolicy | FieldReadFunction, - updatedAt?: FieldPolicy | FieldReadFunction + updatedAt?: FieldPolicy | FieldReadFunction, + externalReference?: FieldPolicy | FieldReadFunction }; export type ProductVariantBackInStockKeySpecifier = ('issuedAt' | 'version' | 'issuingPrincipal' | 'recipient' | 'productVariant' | 'warehouse' | ProductVariantBackInStockKeySpecifier)[]; export type ProductVariantBackInStockFieldPolicy = { @@ -4553,7 +4562,7 @@ export type ShippingZoneUpdatedFieldPolicy = { recipient?: FieldPolicy | FieldReadFunction, shippingZone?: FieldPolicy | FieldReadFunction }; -export type ShopKeySpecifier = ('availablePaymentGateways' | 'availableExternalAuthentications' | 'availableShippingMethods' | 'channelCurrencies' | 'countries' | 'defaultCountry' | 'defaultMailSenderName' | 'defaultMailSenderAddress' | 'description' | 'domain' | 'languages' | 'name' | 'permissions' | 'phonePrefixes' | 'headerText' | 'fulfillmentAutoApprove' | 'fulfillmentAllowUnpaid' | 'trackInventoryByDefault' | 'defaultWeightUnit' | 'translation' | 'automaticFulfillmentDigitalProducts' | 'reserveStockDurationAnonymousUser' | 'reserveStockDurationAuthenticatedUser' | 'limitQuantityPerCheckout' | 'defaultDigitalMaxDownloads' | 'defaultDigitalUrlValidDays' | 'companyAddress' | 'customerSetPasswordUrl' | 'staffNotificationRecipients' | 'limits' | 'version' | 'includeTaxesInPrices' | 'displayGrossPrices' | 'chargeTaxesOnShipping' | ShopKeySpecifier)[]; +export type ShopKeySpecifier = ('availablePaymentGateways' | 'availableExternalAuthentications' | 'availableShippingMethods' | 'channelCurrencies' | 'countries' | 'defaultCountry' | 'defaultMailSenderName' | 'defaultMailSenderAddress' | 'description' | 'domain' | 'languages' | 'name' | 'permissions' | 'phonePrefixes' | 'headerText' | 'fulfillmentAutoApprove' | 'fulfillmentAllowUnpaid' | 'trackInventoryByDefault' | 'defaultWeightUnit' | 'translation' | 'automaticFulfillmentDigitalProducts' | 'reserveStockDurationAnonymousUser' | 'reserveStockDurationAuthenticatedUser' | 'limitQuantityPerCheckout' | 'defaultDigitalMaxDownloads' | 'defaultDigitalUrlValidDays' | 'companyAddress' | 'customerSetPasswordUrl' | 'staffNotificationRecipients' | 'limits' | 'version' | 'schemaVersion' | 'includeTaxesInPrices' | 'displayGrossPrices' | 'chargeTaxesOnShipping' | ShopKeySpecifier)[]; export type ShopFieldPolicy = { availablePaymentGateways?: FieldPolicy | FieldReadFunction, availableExternalAuthentications?: FieldPolicy | FieldReadFunction, @@ -4586,6 +4595,7 @@ export type ShopFieldPolicy = { staffNotificationRecipients?: FieldPolicy | FieldReadFunction, limits?: FieldPolicy | FieldReadFunction, version?: FieldPolicy | FieldReadFunction, + schemaVersion?: FieldPolicy | FieldReadFunction, includeTaxesInPrices?: FieldPolicy | FieldReadFunction, displayGrossPrices?: FieldPolicy | FieldReadFunction, chargeTaxesOnShipping?: FieldPolicy | FieldReadFunction @@ -5096,7 +5106,7 @@ export type UploadErrorFieldPolicy = { message?: FieldPolicy | FieldReadFunction, code?: FieldPolicy | FieldReadFunction }; -export type UserKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'email' | 'firstName' | 'lastName' | 'isStaff' | 'isActive' | 'addresses' | 'checkout' | 'checkoutTokens' | 'checkoutIds' | 'checkouts' | 'giftCards' | 'note' | 'orders' | 'userPermissions' | 'permissionGroups' | 'editableGroups' | 'avatar' | 'events' | 'storedPaymentSources' | 'languageCode' | 'defaultShippingAddress' | 'defaultBillingAddress' | 'lastLogin' | 'dateJoined' | 'updatedAt' | UserKeySpecifier)[]; +export type UserKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'email' | 'firstName' | 'lastName' | 'isStaff' | 'isActive' | 'addresses' | 'checkout' | 'checkoutTokens' | 'checkoutIds' | 'checkouts' | 'giftCards' | 'note' | 'orders' | 'userPermissions' | 'permissionGroups' | 'editableGroups' | 'avatar' | 'events' | 'storedPaymentSources' | 'languageCode' | 'defaultShippingAddress' | 'defaultBillingAddress' | 'externalReference' | 'lastLogin' | 'dateJoined' | 'updatedAt' | UserKeySpecifier)[]; export type UserFieldPolicy = { id?: FieldPolicy | FieldReadFunction, privateMetadata?: FieldPolicy | FieldReadFunction, @@ -5127,6 +5137,7 @@ export type UserFieldPolicy = { languageCode?: FieldPolicy | FieldReadFunction, defaultShippingAddress?: FieldPolicy | FieldReadFunction, defaultBillingAddress?: FieldPolicy | FieldReadFunction, + externalReference?: FieldPolicy | FieldReadFunction, lastLogin?: FieldPolicy | FieldReadFunction, dateJoined?: FieldPolicy | FieldReadFunction, updatedAt?: FieldPolicy | FieldReadFunction @@ -5347,7 +5358,7 @@ export type VoucherUpdatedFieldPolicy = { recipient?: FieldPolicy | FieldReadFunction, voucher?: FieldPolicy | FieldReadFunction }; -export type WarehouseKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'name' | 'slug' | 'email' | 'isPrivate' | 'address' | 'companyName' | 'clickAndCollectOption' | 'shippingZones' | WarehouseKeySpecifier)[]; +export type WarehouseKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'name' | 'slug' | 'email' | 'isPrivate' | 'address' | 'companyName' | 'clickAndCollectOption' | 'shippingZones' | 'externalReference' | WarehouseKeySpecifier)[]; export type WarehouseFieldPolicy = { id?: FieldPolicy | FieldReadFunction, privateMetadata?: FieldPolicy | FieldReadFunction, @@ -5363,7 +5374,8 @@ export type WarehouseFieldPolicy = { address?: FieldPolicy | FieldReadFunction, companyName?: FieldPolicy | FieldReadFunction, clickAndCollectOption?: FieldPolicy | FieldReadFunction, - shippingZones?: FieldPolicy | FieldReadFunction + shippingZones?: FieldPolicy | FieldReadFunction, + externalReference?: FieldPolicy | FieldReadFunction }; export type WarehouseCountableConnectionKeySpecifier = ('pageInfo' | 'edges' | 'totalCount' | WarehouseCountableConnectionKeySpecifier)[]; export type WarehouseCountableConnectionFieldPolicy = { @@ -5471,6 +5483,17 @@ export type WebhookDeleteFieldPolicy = { errors?: FieldPolicy | FieldReadFunction, webhook?: FieldPolicy | FieldReadFunction }; +export type WebhookDryRunKeySpecifier = ('payload' | 'errors' | WebhookDryRunKeySpecifier)[]; +export type WebhookDryRunFieldPolicy = { + payload?: FieldPolicy | FieldReadFunction, + errors?: FieldPolicy | FieldReadFunction +}; +export type WebhookDryRunErrorKeySpecifier = ('field' | 'message' | 'code' | WebhookDryRunErrorKeySpecifier)[]; +export type WebhookDryRunErrorFieldPolicy = { + field?: FieldPolicy | FieldReadFunction, + message?: FieldPolicy | FieldReadFunction, + code?: FieldPolicy | FieldReadFunction +}; export type WebhookErrorKeySpecifier = ('field' | 'message' | 'code' | WebhookErrorKeySpecifier)[]; export type WebhookErrorFieldPolicy = { field?: FieldPolicy | FieldReadFunction, @@ -5492,6 +5515,17 @@ export type WebhookEventSyncFieldPolicy = { name?: FieldPolicy | FieldReadFunction, eventType?: FieldPolicy | FieldReadFunction }; +export type WebhookTriggerKeySpecifier = ('delivery' | 'errors' | WebhookTriggerKeySpecifier)[]; +export type WebhookTriggerFieldPolicy = { + delivery?: FieldPolicy | FieldReadFunction, + errors?: FieldPolicy | FieldReadFunction +}; +export type WebhookTriggerErrorKeySpecifier = ('field' | 'message' | 'code' | WebhookTriggerErrorKeySpecifier)[]; +export type WebhookTriggerErrorFieldPolicy = { + field?: FieldPolicy | FieldReadFunction, + message?: FieldPolicy | FieldReadFunction, + code?: FieldPolicy | FieldReadFunction +}; export type WebhookUpdateKeySpecifier = ('webhookErrors' | 'errors' | 'webhook' | WebhookUpdateKeySpecifier)[]; export type WebhookUpdateFieldPolicy = { webhookErrors?: FieldPolicy | FieldReadFunction, @@ -8144,6 +8178,14 @@ export type StrictTypedTypePolicies = { keyFields?: false | WebhookDeleteKeySpecifier | (() => undefined | WebhookDeleteKeySpecifier), fields?: WebhookDeleteFieldPolicy, }, + WebhookDryRun?: Omit & { + keyFields?: false | WebhookDryRunKeySpecifier | (() => undefined | WebhookDryRunKeySpecifier), + fields?: WebhookDryRunFieldPolicy, + }, + WebhookDryRunError?: Omit & { + keyFields?: false | WebhookDryRunErrorKeySpecifier | (() => undefined | WebhookDryRunErrorKeySpecifier), + fields?: WebhookDryRunErrorFieldPolicy, + }, WebhookError?: Omit & { keyFields?: false | WebhookErrorKeySpecifier | (() => undefined | WebhookErrorKeySpecifier), fields?: WebhookErrorFieldPolicy, @@ -8160,6 +8202,14 @@ export type StrictTypedTypePolicies = { keyFields?: false | WebhookEventSyncKeySpecifier | (() => undefined | WebhookEventSyncKeySpecifier), fields?: WebhookEventSyncFieldPolicy, }, + WebhookTrigger?: Omit & { + keyFields?: false | WebhookTriggerKeySpecifier | (() => undefined | WebhookTriggerKeySpecifier), + fields?: WebhookTriggerFieldPolicy, + }, + WebhookTriggerError?: Omit & { + keyFields?: false | WebhookTriggerErrorKeySpecifier | (() => undefined | WebhookTriggerErrorKeySpecifier), + fields?: WebhookTriggerErrorFieldPolicy, + }, WebhookUpdate?: Omit & { keyFields?: false | WebhookUpdateKeySpecifier | (() => undefined | WebhookUpdateKeySpecifier), fields?: WebhookUpdateFieldPolicy, diff --git a/src/graphql/types.generated.ts b/src/graphql/types.generated.ts index 645273da9..d22874fc6 100644 --- a/src/graphql/types.generated.ts +++ b/src/graphql/types.generated.ts @@ -329,6 +329,12 @@ export type AttributeCreateInput = { storefrontSearchPosition?: InputMaybe; /** Whether the attribute can be displayed in the admin product list. */ availableInGrid?: InputMaybe; + /** + * External ID of this attribute. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; }; /** An enumeration. */ @@ -459,6 +465,12 @@ export type AttributeUpdateInput = { storefrontSearchPosition?: InputMaybe; /** Whether the attribute can be displayed in the admin product list. */ availableInGrid?: InputMaybe; + /** + * External ID of this product. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; }; export type AttributeValueCreateInput = { @@ -482,6 +494,12 @@ export type AttributeValueCreateInput = { fileUrl?: InputMaybe; /** File content type. */ contentType?: InputMaybe; + /** + * External ID of this attribute value. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; /** Name of a value displayed in the interface. */ name: Scalars['String']; }; @@ -494,8 +512,26 @@ export type AttributeValueFilterInput = { export type AttributeValueInput = { /** ID of the selected attribute. */ id?: InputMaybe; - /** The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. */ + /** The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. This field will be removed in Saleor 4.0. */ values?: InputMaybe>; + /** + * Attribute value ID. + * + * Added in Saleor 3.9. + */ + dropdown?: InputMaybe; + /** + * List of attribute value IDs. + * + * Added in Saleor 3.9. + */ + multiselect?: InputMaybe>; + /** + * Numeric value of an attribute. + * + * Added in Saleor 3.9. + */ + numeric?: InputMaybe; /** URL of the file attribute. Every time, a new value is created. */ file?: InputMaybe; /** File content type. */ @@ -514,6 +550,18 @@ export type AttributeValueInput = { dateTime?: InputMaybe; }; +/** + * Represents attribute value. If no ID provided, value will be resolved. + * + * Added in Saleor 3.9. + */ +export type AttributeValueSelectableTypeInput = { + /** ID of an attribute value. */ + id?: InputMaybe; + /** The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. */ + value?: InputMaybe; +}; + export type AttributeValueTranslationInput = { name?: InputMaybe; /** @@ -547,6 +595,12 @@ export type AttributeValueUpdateInput = { fileUrl?: InputMaybe; /** File content type. */ contentType?: InputMaybe; + /** + * External ID of this attribute value. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; /** Name of a value displayed in the interface. */ name?: InputMaybe; }; @@ -1388,6 +1442,12 @@ export type CustomerInput = { note?: InputMaybe; /** User language code. */ languageCode?: InputMaybe; + /** + * External ID of the customer. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; }; export type DateRangeInput = { @@ -1511,6 +1571,12 @@ export type DraftOrderCreateInput = { channelId?: InputMaybe; /** URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. */ redirectUrl?: InputMaybe; + /** + * External ID of this order. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; /** Variant line input consisting of variant ID and quantity of products. */ lines?: InputMaybe>; }; @@ -1536,6 +1602,12 @@ export type DraftOrderInput = { channelId?: InputMaybe; /** URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. */ redirectUrl?: InputMaybe; + /** + * External ID of this order. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; }; export enum EventDeliveryAttemptSortField { @@ -2785,6 +2857,18 @@ export enum MeasurementUnitsEnum { TONNE = 'TONNE' } +export enum MediaChoicesSortField { + /** Sort media by ID. */ + ID = 'ID' +} + +export type MediaSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection; + /** Sort media by the selected field. */ + field: MediaChoicesSortField; +}; + export type MenuCreateInput = { /** Name of the menu. */ name: Scalars['String']; @@ -3351,6 +3435,12 @@ export type OrderUpdateInput = { userEmail?: InputMaybe; /** Shipping address of the customer. */ shippingAddress?: InputMaybe; + /** + * External ID of this order. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; }; export type OrderUpdateShippingInput = { @@ -3883,6 +3973,12 @@ export type ProductCreateInput = { * Added in Saleor 3.8. */ privateMetadata?: InputMaybe>; + /** + * External ID of this product. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; /** ID of the type that product belongs to. */ productType: Scalars['ID']; }; @@ -4028,6 +4124,12 @@ export type ProductInput = { * Added in Saleor 3.8. */ privateMetadata?: InputMaybe>; + /** + * External ID of this product. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; }; export type ProductMediaCreateInput = { @@ -4244,6 +4346,12 @@ export type ProductVariantBulkCreateInput = { * Added in Saleor 3.8. */ privateMetadata?: InputMaybe>; + /** + * External ID of this product variant. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; /** Stocks of a product available for sale. */ stocks?: InputMaybe>; /** List of prices assigned to channels. */ @@ -4306,6 +4414,12 @@ export type ProductVariantCreateInput = { * Added in Saleor 3.8. */ privateMetadata?: InputMaybe>; + /** + * External ID of this product variant. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; /** Product ID of which type is the variant. */ product: Scalars['ID']; /** Stocks of a product available for sale. */ @@ -4359,6 +4473,12 @@ export type ProductVariantInput = { * Added in Saleor 3.8. */ privateMetadata?: InputMaybe>; + /** + * External ID of this product variant. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; }; export enum ProductVariantSortField { @@ -5142,6 +5262,12 @@ export type UserCreateInput = { note?: InputMaybe; /** User language code. */ languageCode?: InputMaybe; + /** + * External ID of the customer. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; /** URL of a view where users should be redirected to set the password. URL in RFC 1808 format. */ redirectUrl?: InputMaybe; /** Slug of a channel which will be used for notify user. Optional when only one channel exists. */ @@ -5320,6 +5446,12 @@ export type WarehouseCreateInput = { slug?: InputMaybe; /** The email address of the warehouse. */ email?: InputMaybe; + /** + * External ID of the warehouse. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; /** Warehouse name. */ name: Scalars['String']; /** Address of the warehouse. */ @@ -5368,6 +5500,12 @@ export type WarehouseUpdateInput = { slug?: InputMaybe; /** The email address of the warehouse. */ email?: InputMaybe; + /** + * External ID of the warehouse. + * + * Added in Saleor 3.10. + */ + externalReference?: InputMaybe; /** Warehouse name. */ name?: InputMaybe; /** Address of the warehouse. */ @@ -5425,13 +5563,22 @@ export type WebhookCreateInput = { query?: InputMaybe; }; +/** An enumeration. */ +export enum WebhookDryRunErrorCode { + GRAPHQL_ERROR = 'GRAPHQL_ERROR', + NOT_FOUND = 'NOT_FOUND', + INVALID_ID = 'INVALID_ID', + MISSING_PERMISSION = 'MISSING_PERMISSION' +} + /** An enumeration. */ export enum WebhookErrorCode { GRAPHQL_ERROR = 'GRAPHQL_ERROR', INVALID = 'INVALID', NOT_FOUND = 'NOT_FOUND', REQUIRED = 'REQUIRED', - UNIQUE = 'UNIQUE' + UNIQUE = 'UNIQUE', + DELETE_FAILED = 'DELETE_FAILED' } /** Enum determining type of webhook. */ @@ -6200,6 +6347,15 @@ export enum WebhookSampleEventTypeEnum { OBSERVABILITY = 'OBSERVABILITY' } +/** An enumeration. */ +export enum WebhookTriggerErrorCode { + GRAPHQL_ERROR = 'GRAPHQL_ERROR', + NOT_FOUND = 'NOT_FOUND', + INVALID_ID = 'INVALID_ID', + MISSING_PERMISSION = 'MISSING_PERMISSION', + MISSING_QUERY = 'MISSING_QUERY' +} + export type WebhookUpdateInput = { /** The new name of the webhook. */ name?: InputMaybe; @@ -6677,6 +6833,29 @@ export type AddressValidationRulesQueryVariables = Exact<{ export type AddressValidationRulesQuery = { __typename: 'Query', addressValidationRules: { __typename: 'AddressValidationData', allowedFields: Array, countryAreaChoices: Array<{ __typename: 'ChoiceValue', raw: string | null, verbose: string | null }> } | null }; +export type TriggerWebhookDryRunMutationVariables = Exact<{ + objectId: Scalars['ID']; + query: Scalars['String']; +}>; + + +export type TriggerWebhookDryRunMutation = { __typename: 'Mutation', webhookDryRun: { __typename: 'WebhookDryRun', payload: any | null, errors: Array<{ __typename: 'WebhookDryRunError', field: string | null, message: string | null }> } | null }; + +export type CheckoutListQueryVariables = Exact<{ + first?: InputMaybe; + after?: InputMaybe; + last?: InputMaybe; + before?: InputMaybe; +}>; + + +export type CheckoutListQuery = { __typename: 'Query', checkouts: { __typename: 'CheckoutCountableConnection', edges: Array<{ __typename: 'CheckoutCountableEdge', cursor: string, node: { __typename: 'Checkout', id: string, created: any } }>, pageInfo: { __typename: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string | null, endCursor: string | null } } | null }; + +export type ChannelListQueryVariables = Exact<{ [key: string]: never; }>; + + +export type ChannelListQuery = { __typename: 'Query', channels: Array<{ __typename: 'Channel', id: string, name: string }> | null }; + export type CheckIfOrderExistsQueryVariables = Exact<{ id: Scalars['ID']; }>; diff --git a/testUtils/mocks/index.ts b/testUtils/mocks/index.ts index c322f956e..43c5befd4 100644 --- a/testUtils/mocks/index.ts +++ b/testUtils/mocks/index.ts @@ -1,4 +1,5 @@ export * from "./address"; export * from "./apps"; export * from "./pageTypes"; +export * from "./products"; export * from "./warehouses"; diff --git a/testUtils/mocks/products.ts b/testUtils/mocks/products.ts new file mode 100644 index 000000000..c4b42cb61 --- /dev/null +++ b/testUtils/mocks/products.ts @@ -0,0 +1,277 @@ +import { MockedResponse } from "@apollo/client/testing"; +import { productListQuery } from "@dashboard/products/queries"; + +export const productsMocks: MockedResponse[] = [ + { + request: { + query: productListQuery, + variables: { + first: 3, + hasChannel: true, + hasSelectedAttributes: true, + }, + }, + result: { + data: { + products: { + edges: [ + { + node: { + id: "UHJvZHVjdDo3Mg==", + name: "Apple Juice", + thumbnail: { + url: "https://wb-t-3-4-6.staging.saleor.cloud/media/thumbnails/products/saleordemoproduct_fd_juice_06_XO6p2Xu_thumbnail_256.png", + __typename: "Image", + }, + productType: { + id: "UHJvZHVjdFR5cGU6OQ==", + name: "Juice", + hasVariants: true, + __typename: "ProductType", + }, + channelListings: [ + { + isPublished: true, + publicationDate: "2020-01-01", + isAvailableForPurchase: true, + availableForPurchase: "2020-08-31", + visibleInListings: true, + channel: { + id: "Q2hhbm5lbDox", + name: "Default channel", + currencyCode: "USD", + __typename: "Channel", + }, + __typename: "ProductChannelListing", + pricing: { + priceRange: { + start: { + net: { + amount: 5.0, + currency: "USD", + __typename: "Money", + }, + __typename: "TaxedMoney", + }, + stop: { + net: { + amount: 7.0, + currency: "USD", + __typename: "Money", + }, + __typename: "TaxedMoney", + }, + __typename: "TaxedMoneyRange", + }, + __typename: "ProductPricingInfo", + }, + }, + ], + __typename: "Product", + updatedAt: "2021-03-10T12:31:34.521213+00:00", + attributes: [ + { + attribute: { + id: "QXR0cmlidXRlOjE2", + __typename: "Attribute", + }, + values: [ + { + id: "QXR0cmlidXRlVmFsdWU6Mw==", + name: "Apple", + slug: "apple", + file: null, + reference: null, + boolean: null, + date: null, + dateTime: null, + value: "", + __typename: "AttributeValue", + }, + ], + __typename: "SelectedAttribute", + }, + ], + }, + __typename: "ProductCountableEdge", + }, + { + node: { + id: "UHJvZHVjdDo3NA==", + name: "Banana Juice", + thumbnail: { + url: "https://wb-t-3-4-6.staging.saleor.cloud/media/thumbnails/products/saleordemoproduct_fd_juice_01_thumbnail_256.png", + __typename: "Image", + }, + productType: { + id: "UHJvZHVjdFR5cGU6OQ==", + name: "Juice", + hasVariants: true, + __typename: "ProductType", + }, + channelListings: [ + { + isPublished: true, + publicationDate: "2020-01-01", + isAvailableForPurchase: true, + availableForPurchase: "2020-08-31", + visibleInListings: true, + channel: { + id: "Q2hhbm5lbDox", + name: "Default channel", + currencyCode: "USD", + __typename: "Channel", + }, + __typename: "ProductChannelListing", + pricing: { + priceRange: { + start: { + net: { + amount: 5.0, + currency: "USD", + __typename: "Money", + }, + __typename: "TaxedMoney", + }, + stop: { + net: { + amount: 7.0, + currency: "USD", + __typename: "Money", + }, + __typename: "TaxedMoney", + }, + __typename: "TaxedMoneyRange", + }, + __typename: "ProductPricingInfo", + }, + }, + ], + __typename: "Product", + updatedAt: "2021-03-10T12:31:34.897799+00:00", + attributes: [ + { + attribute: { + id: "QXR0cmlidXRlOjE2", + __typename: "Attribute", + }, + values: [ + { + id: "QXR0cmlidXRlVmFsdWU6NTA=", + name: "Banana", + slug: "banana", + file: null, + reference: null, + boolean: null, + date: null, + dateTime: null, + value: "", + __typename: "AttributeValue", + }, + ], + __typename: "SelectedAttribute", + }, + ], + }, + __typename: "ProductCountableEdge", + }, + { + node: { + id: "UHJvZHVjdDoxMjI=", + name: "Bathroom Songs", + thumbnail: { + url: "https://wb-t-3-4-6.staging.saleor.cloud/media/thumbnails/products/saleor-digital-03_4_thumbnail_256.png", + __typename: "Image", + }, + productType: { + id: "UHJvZHVjdFR5cGU6MTU=", + name: "Audiobook", + hasVariants: true, + __typename: "ProductType", + }, + channelListings: [ + { + isPublished: true, + publicationDate: "2020-01-01", + isAvailableForPurchase: true, + availableForPurchase: "2020-08-31", + visibleInListings: false, + channel: { + id: "Q2hhbm5lbDox", + name: "Default channel", + currencyCode: "USD", + __typename: "Channel", + }, + __typename: "ProductChannelListing", + pricing: { + priceRange: { + start: { + net: { + amount: 6.0, + currency: "USD", + __typename: "Money", + }, + __typename: "TaxedMoney", + }, + stop: { + net: { + amount: 6.0, + currency: "USD", + __typename: "Money", + }, + __typename: "TaxedMoney", + }, + __typename: "TaxedMoneyRange", + }, + __typename: "ProductPricingInfo", + }, + }, + ], + __typename: "Product", + updatedAt: "2021-03-10T12:31:40.785454+00:00", + attributes: [ + { + attribute: { + id: "QXR0cmlidXRlOjI2", + __typename: "Attribute", + }, + values: [ + { + id: "QXR0cmlidXRlVmFsdWU6ODY=", + name: "Digital Audio", + slug: "digital-audio", + file: null, + reference: null, + boolean: null, + date: null, + dateTime: null, + value: "", + __typename: "AttributeValue", + }, + ], + __typename: "SelectedAttribute", + }, + ], + }, + __typename: "ProductCountableEdge", + }, + ], + pageInfo: { + hasPreviousPage: false, + hasNextPage: true, + startCursor: "WyJhcHBsZS1qdWljZSJd", + endCursor: "WyJiYXRocm9vbS1zb25ncyJd", + __typename: "PageInfo", + }, + totalCount: 41, + __typename: "ProductCountableConnection", + }, + }, + extensions: { + cost: { requestedQueryCost: 13, maximumAvailable: 50000 }, + }, + }, + }, +]; + +export default productsMocks;