(
customProvider: P = provider as any
diff --git a/packages/kibocommerce/src/api/mutations/addItemToWishlist-mutation.ts b/packages/kibocommerce/src/api/mutations/addItemToWishlist-mutation.ts
index f9088b0bb..e89acbece 100644
--- a/packages/kibocommerce/src/api/mutations/addItemToWishlist-mutation.ts
+++ b/packages/kibocommerce/src/api/mutations/addItemToWishlist-mutation.ts
@@ -1,5 +1,5 @@
-import {productDetails} from '../fragments/productDetails'
-const addItemToWishlistMutation = /* GraphQL */`
+import { productDetails } from '../fragments/productDetails'
+const addItemToWishlistMutation = /* GraphQL */ `
mutation createWishlistItem(
$wishlistId: String!
$wishlistItemInput: WishlistItemInput
@@ -15,7 +15,7 @@ const addItemToWishlistMutation = /* GraphQL */`
}
}
}
-${productDetails}
-`;
+ ${productDetails}
+`
-export default addItemToWishlistMutation;
+export default addItemToWishlistMutation
diff --git a/packages/kibocommerce/src/api/mutations/create-wishlist-mutation.ts b/packages/kibocommerce/src/api/mutations/create-wishlist-mutation.ts
index 66ad88309..b8efb1192 100644
--- a/packages/kibocommerce/src/api/mutations/create-wishlist-mutation.ts
+++ b/packages/kibocommerce/src/api/mutations/create-wishlist-mutation.ts
@@ -1,4 +1,4 @@
-const createWishlist = /*GraphQL*/`
+const createWishlist = /*GraphQL*/ `
mutation createWishlist($wishlistInput:WishlistInput!) {
createWishlist(wishlistInput:$wishlistInput){
id
@@ -6,6 +6,6 @@ mutation createWishlist($wishlistInput:WishlistInput!) {
customerAccountId
}
}
-`;
+`
-export default createWishlist;
\ No newline at end of file
+export default createWishlist
diff --git a/packages/kibocommerce/src/api/mutations/login-mutation.ts b/packages/kibocommerce/src/api/mutations/login-mutation.ts
index 730adeda1..f44bf6c1c 100644
--- a/packages/kibocommerce/src/api/mutations/login-mutation.ts
+++ b/packages/kibocommerce/src/api/mutations/login-mutation.ts
@@ -1,7 +1,6 @@
-
-export const loginMutation = /* GraphQL */`
-mutation login($loginInput:CustomerUserAuthInfoInput!) {
- account:createCustomerAuthTicket(customerUserAuthInfoInput:$loginInput) {
+export const loginMutation = /* GraphQL */ `
+ mutation login($loginInput: CustomerUserAuthInfoInput!) {
+ account: createCustomerAuthTicket(customerUserAuthInfoInput: $loginInput) {
accessToken
userId
refreshToken
@@ -17,4 +16,3 @@ mutation login($loginInput:CustomerUserAuthInfoInput!) {
}
}
`
-
diff --git a/packages/kibocommerce/src/api/mutations/removeItemFromCart-mutation.ts b/packages/kibocommerce/src/api/mutations/removeItemFromCart-mutation.ts
index 3cf5c5af5..f98211fca 100644
--- a/packages/kibocommerce/src/api/mutations/removeItemFromCart-mutation.ts
+++ b/packages/kibocommerce/src/api/mutations/removeItemFromCart-mutation.ts
@@ -1,9 +1,9 @@
/*
-* Delete cart based on current user session
-*/
-const removeItemFromCartMutation = /*GraphQL*/`
+ * Delete cart based on current user session
+ */
+const removeItemFromCartMutation = /*GraphQL*/ `
mutation deleteCartItem($id: String!) {
deleteCurrentCartItem(cartItemId:$id)
-}`;
+}`
-export default removeItemFromCartMutation;
+export default removeItemFromCartMutation
diff --git a/packages/kibocommerce/src/api/mutations/removeItemFromWishlist-mutation.ts b/packages/kibocommerce/src/api/mutations/removeItemFromWishlist-mutation.ts
index ce3d994a5..a35bea5fe 100644
--- a/packages/kibocommerce/src/api/mutations/removeItemFromWishlist-mutation.ts
+++ b/packages/kibocommerce/src/api/mutations/removeItemFromWishlist-mutation.ts
@@ -1,8 +1,7 @@
-const removeItemFromWishlistMutation = /* GraphQL */`
-mutation deletewishlistitem($wishlistId: String!, $wishlistItemId: String!) {
- deleteWishlistItem(wishlistId: $wishlistId, wishlistItemId:$wishlistItemId)
+const removeItemFromWishlistMutation = /* GraphQL */ `
+ mutation deletewishlistitem($wishlistId: String!, $wishlistItemId: String!) {
+ deleteWishlistItem(wishlistId: $wishlistId, wishlistItemId: $wishlistItemId)
}
-`;
-
-export default removeItemFromWishlistMutation;
+`
+export default removeItemFromWishlistMutation
diff --git a/packages/kibocommerce/src/api/mutations/signup-mutation.ts b/packages/kibocommerce/src/api/mutations/signup-mutation.ts
index bb25534ab..6c334988b 100644
--- a/packages/kibocommerce/src/api/mutations/signup-mutation.ts
+++ b/packages/kibocommerce/src/api/mutations/signup-mutation.ts
@@ -1,41 +1,46 @@
-
-const registerUserMutation = /* GraphQL */`
-mutation registerUser($customerAccountInput: CustomerAccountInput!) {
- account:createCustomerAccount(customerAccountInput:$customerAccountInput) {
- emailAddress
- userName
- firstName
- lastName
- localeCode
- userId
- id
- isAnonymous
- attributes {
- values
- fullyQualifiedName
- }
+const registerUserMutation = /* GraphQL */ `
+ mutation registerUser($customerAccountInput: CustomerAccountInput!) {
+ account: createCustomerAccount(
+ customerAccountInput: $customerAccountInput
+ ) {
+ emailAddress
+ userName
+ firstName
+ lastName
+ localeCode
+ userId
+ id
+ isAnonymous
+ attributes {
+ values
+ fullyQualifiedName
+ }
}
-}`;
+ }
+`
-const registerUserLoginMutation = /* GraphQL */`
-mutation registerUserLogin($accountId: Int!, $customerLoginInfoInput: CustomerLoginInfoInput!) {
- account:createCustomerAccountLogin(accountId:$accountId, customerLoginInfoInput:$customerLoginInfoInput) {
+const registerUserLoginMutation = /* GraphQL */ `
+ mutation registerUserLogin(
+ $accountId: Int!
+ $customerLoginInfoInput: CustomerLoginInfoInput!
+ ) {
+ account: createCustomerAccountLogin(
+ accountId: $accountId
+ customerLoginInfoInput: $customerLoginInfoInput
+ ) {
accessToken
accessTokenExpiration
refreshToken
refreshTokenExpiration
userId
customerAccount {
- id
- emailAddress
- firstName
- userName
+ id
+ emailAddress
+ firstName
+ userName
}
+ }
}
-}`;
-
-export {
- registerUserMutation,
- registerUserLoginMutation
-};
+`
+export { registerUserMutation, registerUserLoginMutation }
diff --git a/packages/kibocommerce/src/api/mutations/updateCartItemQuantity-mutation.ts b/packages/kibocommerce/src/api/mutations/updateCartItemQuantity-mutation.ts
index 7b2cd5c82..2205bc5a9 100644
--- a/packages/kibocommerce/src/api/mutations/updateCartItemQuantity-mutation.ts
+++ b/packages/kibocommerce/src/api/mutations/updateCartItemQuantity-mutation.ts
@@ -1,9 +1,9 @@
-const updateCartItemQuantityMutation = /*GraphQL*/`
+const updateCartItemQuantityMutation = /*GraphQL*/ `
mutation updateCartItemQuantity($itemId:String!, $quantity: Int!){
updateCurrentCartItemQuantity(cartItemId:$itemId, quantity:$quantity){
id
quantity
}
-}`;
+}`
-export default updateCartItemQuantityMutation;
+export default updateCartItemQuantityMutation
diff --git a/packages/kibocommerce/src/api/operations/get-all-pages.ts b/packages/kibocommerce/src/api/operations/get-all-pages.ts
index 7607e194e..db4b5f3cb 100644
--- a/packages/kibocommerce/src/api/operations/get-all-pages.ts
+++ b/packages/kibocommerce/src/api/operations/get-all-pages.ts
@@ -1,17 +1,14 @@
import type { OperationContext } from '@vercel/commerce/api/operations'
import type { KiboCommerceConfig } from '../index'
import { getAllPagesQuery } from '../queries/get-all-pages-query'
-import { GetPagesQueryParams } from "../../types/page";
+import { GetPagesQueryParams } from '../../types/page'
import { normalizePage } from '../../lib/normalize'
-export type GetAllPagesResult<
- T extends { pages: any[] } = { pages: any[] }
- > = T
+export type GetAllPagesResult = T
export default function getAllPagesOperation({
commerce,
}: OperationContext) {
-
async function getAllPages({
query = getAllPagesQuery,
config,
@@ -25,11 +22,11 @@ export default function getAllPagesOperation({
} = {}): Promise {
const cfg = commerce.getConfig(config)
variables = {
- documentListName: cfg.documentListName
+ documentListName: cfg.documentListName,
}
- const { data } = await cfg.fetch(query, { variables });
+ const { data } = await cfg.fetch(query, { variables })
- const pages = data.documentListDocuments.items.map(normalizePage);
+ const pages = data.documentListDocuments.items.map(normalizePage)
return { pages }
}
diff --git a/packages/kibocommerce/src/api/operations/get-all-product-paths.ts b/packages/kibocommerce/src/api/operations/get-all-product-paths.ts
index 3067b67fc..37203d012 100644
--- a/packages/kibocommerce/src/api/operations/get-all-product-paths.ts
+++ b/packages/kibocommerce/src/api/operations/get-all-product-paths.ts
@@ -1,24 +1,31 @@
import { KiboCommerceConfig } from '../index'
-import { getAllProductsQuery } from '../queries/get-all-products-query';
+import { getAllProductsQuery } from '../queries/get-all-products-query'
import { normalizeProduct } from '../../lib/normalize'
export type GetAllProductPathsResult = {
products: Array<{ path: string }>
}
-export default function getAllProductPathsOperation({commerce,}: any) {
- async function getAllProductPaths({ config }: {config?: KiboCommerceConfig } = {}): Promise {
-
+export default function getAllProductPathsOperation({ commerce }: any) {
+ async function getAllProductPaths({
+ config,
+ }: { config?: KiboCommerceConfig } = {}): Promise {
const cfg = commerce.getConfig(config)
- const productVariables = {startIndex: 0, pageSize: 100};
- const { data } = await cfg.fetch(getAllProductsQuery, { variables: productVariables });
+ const productVariables = { startIndex: 0, pageSize: 100 }
+ const { data } = await cfg.fetch(getAllProductsQuery, {
+ variables: productVariables,
+ })
- const normalizedProducts = data.products.items ? data.products.items.map( (item:any) => normalizeProduct(item, cfg)) : [];
- const products = normalizedProducts.map((product: any) => ({ path: product.path }))
+ const normalizedProducts = data.products.items
+ ? data.products.items.map((item: any) => normalizeProduct(item, cfg))
+ : []
+ const products = normalizedProducts.map((product: any) => ({
+ path: product.path,
+ }))
return Promise.resolve({
- products: products
+ products: products,
})
}
diff --git a/packages/kibocommerce/src/api/operations/get-all-products.ts b/packages/kibocommerce/src/api/operations/get-all-products.ts
index bddafbffa..3808ce860 100644
--- a/packages/kibocommerce/src/api/operations/get-all-products.ts
+++ b/packages/kibocommerce/src/api/operations/get-all-products.ts
@@ -2,7 +2,7 @@ import { Product } from '@vercel/commerce/types/product'
import { GetAllProductsOperation } from '@vercel/commerce/types/product'
import type { OperationContext } from '@vercel/commerce/api/operations'
import type { KiboCommerceConfig } from '../index'
-import { getAllProductsQuery } from '../queries/get-all-products-query';
+import { getAllProductsQuery } from '../queries/get-all-products-query'
import { normalizeProduct } from '../../lib/normalize'
export default function getAllProductsOperation({
@@ -18,11 +18,12 @@ export default function getAllProductsOperation({
config?: Partial
preview?: boolean
} = {}): Promise<{ products: Product[] | any[] }> {
-
const cfg = commerce.getConfig(config)
- const { data } = await cfg.fetch(query);
+ const { data } = await cfg.fetch(query)
- let normalizedProducts = data.products.items ? data.products.items.map( (item:any) => normalizeProduct(item, cfg)) : [];
+ let normalizedProducts = data.products.items
+ ? data.products.items.map((item: any) => normalizeProduct(item, cfg))
+ : []
return {
products: normalizedProducts,
diff --git a/packages/kibocommerce/src/api/operations/get-customer-wishlist.ts b/packages/kibocommerce/src/api/operations/get-customer-wishlist.ts
index c2792ad32..2a1f8ac1d 100644
--- a/packages/kibocommerce/src/api/operations/get-customer-wishlist.ts
+++ b/packages/kibocommerce/src/api/operations/get-customer-wishlist.ts
@@ -9,7 +9,7 @@ import type {
// import type { RecursivePartial, RecursiveRequired } from '../utils/types'
import { KiboCommerceConfig } from '..'
// import getAllProducts, { ProductEdge } from './get-all-products'
-import {getCustomerWishlistQuery} from '../queries/get-customer-wishlist-query'
+import { getCustomerWishlistQuery } from '../queries/get-customer-wishlist-query'
export default function getCustomerWishlistOperation({
commerce,
@@ -40,14 +40,15 @@ export default function getCustomerWishlistOperation({
config?: KiboCommerceConfig
includeProducts?: boolean
}): Promise {
- let customerWishlist ={}
+ let customerWishlist = {}
try {
-
config = commerce.getConfig(config)
- const result= await config?.fetch(getCustomerWishlistQuery,{variables})
- customerWishlist= result?.data?.customerWishlist;
- } catch(e) {
- customerWishlist= {}
+ const result = await config?.fetch(getCustomerWishlistQuery, {
+ variables,
+ })
+ customerWishlist = result?.data?.customerWishlist
+ } catch (e) {
+ customerWishlist = {}
}
return { wishlist: customerWishlist as any }
diff --git a/packages/kibocommerce/src/api/operations/get-page.ts b/packages/kibocommerce/src/api/operations/get-page.ts
index 69289cba0..f8cfa3cd1 100644
--- a/packages/kibocommerce/src/api/operations/get-page.ts
+++ b/packages/kibocommerce/src/api/operations/get-page.ts
@@ -1,15 +1,11 @@
-import type {
- OperationContext,
-} from '@vercel/commerce/api/operations'
+import type { OperationContext } from '@vercel/commerce/api/operations'
import type { KiboCommerceConfig, KiboCommerceProvider } from '..'
import { normalizePage } from '../../lib/normalize'
import { getPageQuery } from '../queries/get-page-query'
-import type { Page, GetPageQueryParams } from "../../types/page";
+import type { Page, GetPageQueryParams } from '../../types/page'
import type { Document } from '../../../schema'
-export default function getPageOperation({
- commerce,
-}: OperationContext) {
+export default function getPageOperation({ commerce }: OperationContext) {
async function getPage({
url,
variables,
@@ -24,11 +20,14 @@ export default function getPageOperation({
// RecursivePartial forces the method to check for every prop in the data, which is
// required in case there's a custom `url`
const cfg = commerce.getConfig(config)
- const pageVariables = { documentListName: cfg.documentListName, filter: `id eq ${variables.id}` }
+ const pageVariables = {
+ documentListName: cfg.documentListName,
+ filter: `id eq ${variables.id}`,
+ }
const { data } = await cfg.fetch(getPageQuery, { variables: pageVariables })
- const firstPage = data.documentListDocuments.items?.[0];
+ const firstPage = data.documentListDocuments.items?.[0]
const page = firstPage as Document
if (preview || page?.properties?.is_visible) {
return { page: normalizePage(page as any) }
diff --git a/packages/kibocommerce/src/api/operations/get-product.ts b/packages/kibocommerce/src/api/operations/get-product.ts
index c41b1bf04..2cc2b3130 100644
--- a/packages/kibocommerce/src/api/operations/get-product.ts
+++ b/packages/kibocommerce/src/api/operations/get-product.ts
@@ -8,7 +8,6 @@ import { normalizeProduct } from '../../lib/normalize'
export default function getProductOperation({
commerce,
}: OperationContext) {
-
async function getProduct({
query = getProductQuery,
variables,
@@ -19,15 +18,15 @@ export default function getProductOperation({
config?: Partial
preview?: boolean
} = {}): Promise {
- const productVariables = { productCode: variables?.slug}
+ const productVariables = { productCode: variables?.slug }
const cfg = commerce.getConfig(config)
- const { data } = await cfg.fetch(query, { variables: productVariables });
+ const { data } = await cfg.fetch(query, { variables: productVariables })
const normalizedProduct = normalizeProduct(data.product, cfg)
return {
- product: normalizedProduct
+ product: normalizedProduct,
}
}
diff --git a/packages/kibocommerce/src/api/operations/get-site-info.ts b/packages/kibocommerce/src/api/operations/get-site-info.ts
index 6b72d3b47..10644d85d 100644
--- a/packages/kibocommerce/src/api/operations/get-site-info.ts
+++ b/packages/kibocommerce/src/api/operations/get-site-info.ts
@@ -1,7 +1,7 @@
import { OperationContext } from '@vercel/commerce/api/operations'
import { Category } from '@vercel/commerce/types/site'
import { KiboCommerceConfig } from '../index'
-import {categoryTreeQuery} from '../queries/get-categories-tree-query'
+import { categoryTreeQuery } from '../queries/get-categories-tree-query'
import { normalizeCategory } from '../../lib/normalize'
export type GetSiteInfoResult<
@@ -11,9 +11,11 @@ export type GetSiteInfoResult<
}
> = T
-export default function getSiteInfoOperation({commerce}: OperationContext) {
+export default function getSiteInfoOperation({
+ commerce,
+}: OperationContext) {
async function getSiteInfo({
- query= categoryTreeQuery,
+ query = categoryTreeQuery,
variables,
config,
}: {
@@ -23,8 +25,8 @@ export default function getSiteInfoOperation({commerce}: OperationContext)
preview?: boolean
} = {}): Promise {
const cfg = commerce.getConfig(config)
- const { data } = await cfg.fetch(query);
- const categories= data.categories.items.map(normalizeCategory);
+ const { data } = await cfg.fetch(query)
+ const categories = data.categories.items.map(normalizeCategory)
return Promise.resolve({
categories: categories ?? [],
brands: [],
diff --git a/packages/kibocommerce/src/api/queries/get-all-pages-query.ts b/packages/kibocommerce/src/api/queries/get-all-pages-query.ts
index 6926914f5..73a30da24 100644
--- a/packages/kibocommerce/src/api/queries/get-all-pages-query.ts
+++ b/packages/kibocommerce/src/api/queries/get-all-pages-query.ts
@@ -1,6 +1,6 @@
-export const getAllPagesQuery = /* GraphQL */`
-query($documentListName: String!) {
- documentListDocuments(documentListName:$documentListName){
+export const getAllPagesQuery = /* GraphQL */ `
+ query ($documentListName: String!) {
+ documentListDocuments(documentListName: $documentListName) {
items {
id
name
@@ -8,4 +8,5 @@ query($documentListName: String!) {
properties
}
}
- }`;
\ No newline at end of file
+ }
+`
diff --git a/packages/kibocommerce/src/api/queries/get-all-products-query.ts b/packages/kibocommerce/src/api/queries/get-all-products-query.ts
index 3c6599e34..d9a8da314 100644
--- a/packages/kibocommerce/src/api/queries/get-all-products-query.ts
+++ b/packages/kibocommerce/src/api/queries/get-all-products-query.ts
@@ -1,21 +1,13 @@
-import { productInfo } from '../fragments/product';
+import { productInfo } from '../fragments/product'
-export const getAllProductsQuery = /* GraphQL */`
-${productInfo}
+export const getAllProductsQuery = /* GraphQL */ `
+ ${productInfo}
-query products(
- $filter: String
- $startIndex: Int
- $pageSize: Int
-) {
- products(
- filter: $filter
- startIndex: $startIndex
- pageSize: $pageSize
- ) {
- items {
- ...productInfo
+ query products($filter: String, $startIndex: Int, $pageSize: Int) {
+ products(filter: $filter, startIndex: $startIndex, pageSize: $pageSize) {
+ items {
+ ...productInfo
+ }
}
}
-}
-`
\ No newline at end of file
+`
diff --git a/packages/kibocommerce/src/api/queries/get-cart-query.ts b/packages/kibocommerce/src/api/queries/get-cart-query.ts
index 5bbf5bbfa..eb4d24510 100644
--- a/packages/kibocommerce/src/api/queries/get-cart-query.ts
+++ b/packages/kibocommerce/src/api/queries/get-cart-query.ts
@@ -1,6 +1,6 @@
import { productDetails } from '../fragments/productDetails'
-export const getCartQuery = /* GraphQL */`
-query cart {
+export const getCartQuery = /* GraphQL */ `
+ query cart {
currentCart {
id
userId
@@ -8,7 +8,7 @@ query cart {
impact
discount {
id
- name
+ name
}
couponCode
}
@@ -18,15 +18,15 @@ query cart {
items {
id
subtotal
- unitPrice{
+ unitPrice {
extendedAmount
}
- product {
- ...productDetails
- }
- quantity
+ product {
+ ...productDetails
}
+ quantity
}
}
-${productDetails}
+ }
+ ${productDetails}
`
diff --git a/packages/kibocommerce/src/api/queries/get-categories-tree-query.ts b/packages/kibocommerce/src/api/queries/get-categories-tree-query.ts
index 984833630..b5f0a61f3 100644
--- a/packages/kibocommerce/src/api/queries/get-categories-tree-query.ts
+++ b/packages/kibocommerce/src/api/queries/get-categories-tree-query.ts
@@ -1,29 +1,30 @@
import { CategoryInfo } from '../fragments/category'
-export const categoryTreeQuery = /* GraphQL */`
-query GetCategoryTree {
+export const categoryTreeQuery = /* GraphQL */ `
+ query GetCategoryTree {
categories: categoriesTree {
items {
...categoryInfo
childrenCategories {
+ ...categoryInfo
+ childrenCategories {
...categoryInfo
childrenCategories {
+ ...categoryInfo
+ childrenCategories {
...categoryInfo
childrenCategories {
+ ...categoryInfo
+ childrenCategories {
...categoryInfo
- childrenCategories {
- ...categoryInfo
- childrenCategories {
- ...categoryInfo
- childrenCategories {
- ...categoryInfo
- }
- }
- }
+ }
}
+ }
}
+ }
}
}
}
-}
-${CategoryInfo}`;
\ No newline at end of file
+ }
+ ${CategoryInfo}
+`
diff --git a/packages/kibocommerce/src/api/queries/get-customer-account-query.ts b/packages/kibocommerce/src/api/queries/get-customer-account-query.ts
index 9528b8467..3bb641cae 100644
--- a/packages/kibocommerce/src/api/queries/get-customer-account-query.ts
+++ b/packages/kibocommerce/src/api/queries/get-customer-account-query.ts
@@ -1,12 +1,12 @@
-export const getCustomerAccountQuery = /* GraphQL */`
-query getUser {
- customerAccount:getCurrentAccount {
- id
- firstName
- lastName
- emailAddress
- userName
- isAnonymous
+export const getCustomerAccountQuery = /* GraphQL */ `
+ query getUser {
+ customerAccount: getCurrentAccount {
+ id
+ firstName
+ lastName
+ emailAddress
+ userName
+ isAnonymous
}
-}
-`
\ No newline at end of file
+ }
+`
diff --git a/packages/kibocommerce/src/api/queries/get-customer-wishlist-query.ts b/packages/kibocommerce/src/api/queries/get-customer-wishlist-query.ts
index d2ae3edec..ad24d0a4d 100644
--- a/packages/kibocommerce/src/api/queries/get-customer-wishlist-query.ts
+++ b/packages/kibocommerce/src/api/queries/get-customer-wishlist-query.ts
@@ -1,25 +1,28 @@
-import {productDetails} from '../fragments/productDetails'
-export const getCustomerWishlistQuery= /* GraphQL */`
-query wishlist($customerId: Int!, $wishlistName: String!) {
- customerWishlist(customerAccountId:$customerId ,wishlistName: $wishlistName){
+import { productDetails } from '../fragments/productDetails'
+export const getCustomerWishlistQuery = /* GraphQL */ `
+ query wishlist($customerId: Int!, $wishlistName: String!) {
+ customerWishlist(
+ customerAccountId: $customerId
+ wishlistName: $wishlistName
+ ) {
customerAccountId
name
id
userId
items {
- id
+ id
quantity
total
subtotal
- unitPrice{
+ unitPrice {
extendedAmount
}
quantity
product {
...productDetails
+ }
}
- }
}
}
-${productDetails}
-`
\ No newline at end of file
+ ${productDetails}
+`
diff --git a/packages/kibocommerce/src/api/queries/get-page-query.ts b/packages/kibocommerce/src/api/queries/get-page-query.ts
index 69371d003..95d66ef29 100644
--- a/packages/kibocommerce/src/api/queries/get-page-query.ts
+++ b/packages/kibocommerce/src/api/queries/get-page-query.ts
@@ -1,14 +1,17 @@
-export const getPageQuery = /* GraphQL */`
-query($documentListName: String!, $filter: String!) {
- documentListDocuments(documentListName: $documentListName, filter: $filter){
- startIndex
- totalCount
- items {
- id
- name
- listFQN
- properties
- }
- }
+export const getPageQuery = /* GraphQL */ `
+ query ($documentListName: String!, $filter: String!) {
+ documentListDocuments(
+ documentListName: $documentListName
+ filter: $filter
+ ) {
+ startIndex
+ totalCount
+ items {
+ id
+ name
+ listFQN
+ properties
+ }
}
-`;
\ No newline at end of file
+ }
+`
diff --git a/packages/kibocommerce/src/api/queries/get-product-query.ts b/packages/kibocommerce/src/api/queries/get-product-query.ts
index 47db311e4..c28df2845 100644
--- a/packages/kibocommerce/src/api/queries/get-product-query.ts
+++ b/packages/kibocommerce/src/api/queries/get-product-query.ts
@@ -1,15 +1,11 @@
-import { productInfo } from '../fragments/product';
+import { productInfo } from '../fragments/product'
-export const getProductQuery = /* GraphQL */`
-${productInfo}
+export const getProductQuery = /* GraphQL */ `
+ ${productInfo}
- query product(
- $productCode: String!
- ) {
- product(
- productCode: $productCode
- ) {
+ query product($productCode: String!) {
+ product(productCode: $productCode) {
...productInfo
}
}
-`
\ No newline at end of file
+`
diff --git a/packages/kibocommerce/src/api/queries/product-search-query.ts b/packages/kibocommerce/src/api/queries/product-search-query.ts
index d22f0ef12..e1df01652 100644
--- a/packages/kibocommerce/src/api/queries/product-search-query.ts
+++ b/packages/kibocommerce/src/api/queries/product-search-query.ts
@@ -1,20 +1,27 @@
import { searchResults } from '../fragments/search'
-const query = /* GraphQL */`
-query ProductSearch($query:String, $startIndex:Int,
- $pageSize:Int, $sortBy:String, $filter:String,$facetTemplate:String,$facetValueFilter:String ) {
- products:productSearch (
- query:$query,
- startIndex: $startIndex,
- pageSize:$pageSize,
- sortBy: $sortBy,
- filter:$filter,
- facetTemplate:$facetTemplate,
- facetValueFilter:$facetValueFilter
- ) {
- ...searchResults
- }
+const query = /* GraphQL */ `
+ query ProductSearch(
+ $query: String
+ $startIndex: Int
+ $pageSize: Int
+ $sortBy: String
+ $filter: String
+ $facetTemplate: String
+ $facetValueFilter: String
+ ) {
+ products: productSearch(
+ query: $query
+ startIndex: $startIndex
+ pageSize: $pageSize
+ sortBy: $sortBy
+ filter: $filter
+ facetTemplate: $facetTemplate
+ facetValueFilter: $facetValueFilter
+ ) {
+ ...searchResults
}
- ${searchResults}
-`;
-export default query;
+ }
+ ${searchResults}
+`
+export default query
diff --git a/packages/kibocommerce/src/api/utils/api-auth-helper.ts b/packages/kibocommerce/src/api/utils/api-auth-helper.ts
index 20cfc7403..c04b6ec29 100644
--- a/packages/kibocommerce/src/api/utils/api-auth-helper.ts
+++ b/packages/kibocommerce/src/api/utils/api-auth-helper.ts
@@ -41,8 +41,8 @@ export class APIAuthenticationHelper {
this._clientId = clientId
this._sharedSecret = sharedSecret
this._authUrl = authUrl
- if(!authTicketCache) {
- this._authTicketCache = new RuntimeMemCache();
+ if (!authTicketCache) {
+ this._authTicketCache = new RuntimeMemCache()
}
}
private _buildFetchOptions(body: any = {}): FetchOptions {
diff --git a/packages/kibocommerce/src/api/utils/cookie-handler.ts b/packages/kibocommerce/src/api/utils/cookie-handler.ts
index b4c950fea..542d98669 100644
--- a/packages/kibocommerce/src/api/utils/cookie-handler.ts
+++ b/packages/kibocommerce/src/api/utils/cookie-handler.ts
@@ -6,8 +6,8 @@ import { NextApiRequest } from 'next'
import getAnonymousShopperToken from './get-anonymous-shopper-token'
const parseCookie = (cookieValue?: any) => {
- return cookieValue
- ? JSON.parse(Buffer.from(cookieValue, 'base64').toString('ascii'))
+ return cookieValue
+ ? JSON.parse(Buffer.from(cookieValue, 'base64').toString('ascii'))
: null
}
export default class CookieHandler {
@@ -37,8 +37,8 @@ export default class CookieHandler {
isShopperCookieAnonymous() {
const customerCookieKey = this.config.customerCookie
const shopperCookie = this.request.cookies[customerCookieKey]
- const shopperSession = parseCookie(shopperCookie);
- const isAnonymous = shopperSession?.customerAccount ? false : true
+ const shopperSession = parseCookie(shopperCookie)
+ const isAnonymous = shopperSession?.customerAccount ? false : true
return isAnonymous
}
setAnonymousShopperCookie(anonymousShopperTokenResponse: any) {
diff --git a/packages/kibocommerce/src/api/utils/fetch-graphql-api.ts b/packages/kibocommerce/src/api/utils/fetch-graphql-api.ts
index cf84f5e41..bbc72ba5a 100644
--- a/packages/kibocommerce/src/api/utils/fetch-graphql-api.ts
+++ b/packages/kibocommerce/src/api/utils/fetch-graphql-api.ts
@@ -2,42 +2,46 @@ import { FetcherError } from '@vercel/commerce/utils/errors'
import type { GraphQLFetcher } from '@vercel/commerce/api'
import type { KiboCommerceConfig } from '../index'
import fetch from './fetch'
-import { APIAuthenticationHelper } from './api-auth-helper';
+import { APIAuthenticationHelper } from './api-auth-helper'
const fetchGraphqlApi: (
getConfig: () => KiboCommerceConfig
-) => GraphQLFetcher = (getConfig) => async (
- query: string,
- { variables, preview } = {},
- fetchOptions
-) => {
- const config = getConfig()
- const authHelper = new APIAuthenticationHelper(config);
- const apiToken = await authHelper.getAccessToken();
- const res = await fetch(config.commerceUrl + (preview ? '/preview' : ''), {
- ...fetchOptions,
- method: 'POST',
- headers: {
- ...fetchOptions?.headers,
- Authorization: `Bearer ${apiToken}`,
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- query,
- variables,
- }),
- })
-
- const json = await res.json()
- if (json.errors) {
- console.warn(`Kibo API Request Correlation ID: ${res.headers.get('x-vol-correlation')}`);
- throw new FetcherError({
- errors: json.errors ?? [{ message: 'Failed to fetch KiboCommerce API' }],
- status: res.status,
+) => GraphQLFetcher =
+ (getConfig) =>
+ async (query: string, { variables, preview } = {}, fetchOptions) => {
+ const config = getConfig()
+ const authHelper = new APIAuthenticationHelper(config)
+ const apiToken = await authHelper.getAccessToken()
+ const res = await fetch(config.commerceUrl + (preview ? '/preview' : ''), {
+ ...fetchOptions,
+ method: 'POST',
+ headers: {
+ ...fetchOptions?.headers,
+ Authorization: `Bearer ${apiToken}`,
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ query,
+ variables,
+ }),
})
+
+ const json = await res.json()
+ if (json.errors) {
+ console.warn(
+ `Kibo API Request Correlation ID: ${res.headers.get(
+ 'x-vol-correlation'
+ )}`
+ )
+ throw new FetcherError({
+ errors: json.errors ?? [
+ { message: 'Failed to fetch KiboCommerce API' },
+ ],
+ status: res.status,
+ })
+ }
+
+ return { data: json.data, res }
}
- return { data: json.data, res }
-}
-
export default fetchGraphqlApi
diff --git a/packages/kibocommerce/src/api/utils/fetch-local.ts b/packages/kibocommerce/src/api/utils/fetch-local.ts
index fa3a214cb..146eb8a8e 100644
--- a/packages/kibocommerce/src/api/utils/fetch-local.ts
+++ b/packages/kibocommerce/src/api/utils/fetch-local.ts
@@ -3,12 +3,14 @@ import type { GraphQLFetcher } from '@vercel/commerce/api'
import type { KiboCommerceConfig } from '../index'
import fetch from './fetch'
-const fetchGraphqlApi: (getConfig: () => KiboCommerceConfig) => GraphQLFetcher =
+const fetchGraphqlApi: (
+ getConfig: () => KiboCommerceConfig
+) => GraphQLFetcher =
(getConfig) =>
async (query: string, { variables, preview } = {}, fetchOptions) => {
const config = getConfig()
const res = await fetch(config.commerceUrl, {
- //const res = await fetch(config.commerceUrl + (preview ? '/preview' : ''), {
+ //const res = await fetch(config.commerceUrl + (preview ? '/preview' : ''), {
...fetchOptions,
method: 'POST',
headers: {
@@ -25,7 +27,9 @@ const fetchGraphqlApi: (getConfig: () => KiboCommerceConfig) => GraphQLFetcher =
const json = await res.json()
if (json.errors) {
throw new FetcherError({
- errors: json.errors ?? [{ message: 'Failed to fetch KiboCommerce API' }],
+ errors: json.errors ?? [
+ { message: 'Failed to fetch KiboCommerce API' },
+ ],
status: res.status,
})
}
diff --git a/packages/kibocommerce/src/api/utils/get-customer-id.ts b/packages/kibocommerce/src/api/utils/get-customer-id.ts
index 5ba3d7787..f96000976 100644
--- a/packages/kibocommerce/src/api/utils/get-customer-id.ts
+++ b/packages/kibocommerce/src/api/utils/get-customer-id.ts
@@ -8,17 +8,15 @@ async function getCustomerId({
customerToken: string
config: KiboCommerceConfig
}): Promise {
- const token = customerToken ? Buffer.from(customerToken, 'base64').toString('ascii'): null;
- const accessToken = token ? JSON.parse(token).accessToken : null;
- const { data } = await config.fetch(
- getCustomerAccountQuery,
- undefined,
- {
- headers: {
- 'x-vol-user-claims': accessToken,
- },
- }
- )
+ const token = customerToken
+ ? Buffer.from(customerToken, 'base64').toString('ascii')
+ : null
+ const accessToken = token ? JSON.parse(token).accessToken : null
+ const { data } = await config.fetch(getCustomerAccountQuery, undefined, {
+ headers: {
+ 'x-vol-user-claims': accessToken,
+ },
+ })
return data?.customerAccount?.id
}
diff --git a/packages/kibocommerce/src/auth/use-logout.tsx b/packages/kibocommerce/src/auth/use-logout.tsx
index 83e5a4b0c..18592d6ab 100644
--- a/packages/kibocommerce/src/auth/use-logout.tsx
+++ b/packages/kibocommerce/src/auth/use-logout.tsx
@@ -12,18 +12,20 @@ export const handler: MutationHook = {
url: '/api/logout',
method: 'GET',
},
- useHook: ({ fetch }) => () => {
- const { mutate } = useCustomer()
- const { mutate: mutateCart } = useCart()
+ useHook:
+ ({ fetch }) =>
+ () => {
+ const { mutate } = useCustomer()
+ const { mutate: mutateCart } = useCart()
- return useCallback(
- async function logout() {
- const data = await fetch()
- await mutate(null, false)
- await mutateCart(null, false)
- return data
- },
- [fetch, mutate, mutateCart]
- )
- },
+ return useCallback(
+ async function logout() {
+ const data = await fetch()
+ await mutate(null, false)
+ await mutateCart(null, false)
+ return data
+ },
+ [fetch, mutate, mutateCart]
+ )
+ },
}
diff --git a/packages/kibocommerce/src/cart/use-add-item.tsx b/packages/kibocommerce/src/cart/use-add-item.tsx
index bb7b8befc..f65e82bc7 100644
--- a/packages/kibocommerce/src/cart/use-add-item.tsx
+++ b/packages/kibocommerce/src/cart/use-add-item.tsx
@@ -29,16 +29,18 @@ export const handler: MutationHook = {
return data
},
- useHook: ({ fetch }) => () => {
- const { mutate } = useCart()
+ useHook:
+ ({ fetch }) =>
+ () => {
+ const { mutate } = useCart()
- return useCallback(
- async function addItem(input) {
- const data = await fetch({ input })
- await mutate(data, false)
- return data
- },
- [fetch, mutate]
- )
- },
+ return useCallback(
+ async function addItem(input) {
+ const data = await fetch({ input })
+ await mutate(data, false)
+ return data
+ },
+ [fetch, mutate]
+ )
+ },
}
diff --git a/packages/kibocommerce/src/cart/use-cart.tsx b/packages/kibocommerce/src/cart/use-cart.tsx
index 0af0738ec..2d4924341 100644
--- a/packages/kibocommerce/src/cart/use-cart.tsx
+++ b/packages/kibocommerce/src/cart/use-cart.tsx
@@ -12,22 +12,24 @@ export const handler: SWRHook = {
async fetcher({ options, fetch }) {
return await fetch({ ...options })
},
- useHook: ({ useData }) => (input) => {
- const response = useData({
- swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },
- })
+ useHook:
+ ({ useData }) =>
+ (input) => {
+ const response = useData({
+ swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },
+ })
- return useMemo(
- () =>
- Object.create(response, {
- isEmpty: {
- get() {
- return (response.data?.lineItems.length ?? 0) <= 0
+ return useMemo(
+ () =>
+ Object.create(response, {
+ isEmpty: {
+ get() {
+ return (response.data?.lineItems.length ?? 0) <= 0
+ },
+ enumerable: true,
},
- enumerable: true,
- },
- }),
- [response]
- )
- },
+ }),
+ [response]
+ )
+ },
}
diff --git a/packages/kibocommerce/src/cart/use-remove-item.tsx b/packages/kibocommerce/src/cart/use-remove-item.tsx
index 3fa883c2f..bed12c96b 100644
--- a/packages/kibocommerce/src/cart/use-remove-item.tsx
+++ b/packages/kibocommerce/src/cart/use-remove-item.tsx
@@ -4,8 +4,14 @@ import type {
HookFetcherContext,
} from '@vercel/commerce/utils/types'
import { ValidationError } from '@vercel/commerce/utils/errors'
-import useRemoveItem, { UseRemoveItem } from '@vercel/commerce/cart/use-remove-item'
-import type { Cart, LineItem, RemoveItemHook } from '@vercel/commerce/types/cart'
+import useRemoveItem, {
+ UseRemoveItem,
+} from '@vercel/commerce/cart/use-remove-item'
+import type {
+ Cart,
+ LineItem,
+ RemoveItemHook,
+} from '@vercel/commerce/types/cart'
import useCart from './use-cart'
export type RemoveItemFn = T extends LineItem
@@ -30,27 +36,25 @@ export const handler = {
}: HookFetcherContext) {
return await fetch({ ...options, body: { itemId } })
},
- useHook: ({ fetch }: MutationHookContext) => <
- T extends LineItem | undefined = undefined
- >(
- ctx: { item?: T } = {}
- ) => {
- const { item } = ctx
- const { mutate } = useCart()
- const removeItem: RemoveItemFn = async (input) => {
- const itemId = input?.id ?? item?.id
+ useHook:
+ ({ fetch }: MutationHookContext) =>
+ (ctx: { item?: T } = {}) => {
+ const { item } = ctx
+ const { mutate } = useCart()
+ const removeItem: RemoveItemFn = async (input) => {
+ const itemId = input?.id ?? item?.id
- if (!itemId) {
- throw new ValidationError({
- message: 'Invalid input used for this operation',
- })
+ if (!itemId) {
+ throw new ValidationError({
+ message: 'Invalid input used for this operation',
+ })
+ }
+
+ const data = await fetch({ input: { itemId } })
+ await mutate(data, false)
+ return data
}
- const data = await fetch({ input: { itemId } })
- await mutate(data, false)
- return data
- }
-
- return useCallback(removeItem as RemoveItemFn, [fetch, mutate])
- },
+ return useCallback(removeItem as RemoveItemFn, [fetch, mutate])
+ },
}
diff --git a/packages/kibocommerce/src/cart/use-update-item.tsx b/packages/kibocommerce/src/cart/use-update-item.tsx
index 931782c4f..0effac320 100644
--- a/packages/kibocommerce/src/cart/use-update-item.tsx
+++ b/packages/kibocommerce/src/cart/use-update-item.tsx
@@ -5,7 +5,9 @@ import type {
HookFetcherContext,
} from '@vercel/commerce/utils/types'
import { ValidationError } from '@vercel/commerce/utils/errors'
-import useUpdateItem, { UseUpdateItem } from '@vercel/commerce/cart/use-update-item'
+import useUpdateItem, {
+ UseUpdateItem,
+} from '@vercel/commerce/cart/use-update-item'
import type { LineItem, UpdateItemHook } from '@vercel/commerce/types/cart'
import { handler as removeItemHandler } from './use-remove-item'
import useCart from './use-cart'
@@ -46,39 +48,39 @@ export const handler = {
body: { itemId, item },
})
},
- useHook: ({ fetch }: MutationHookContext) => <
- T extends LineItem | undefined = undefined
- >(
- ctx: {
- item?: T
- wait?: number
- } = {}
- ) => {
- const { item } = ctx
- const { mutate } = useCart() as any
+ useHook:
+ ({ fetch }: MutationHookContext) =>
+ (
+ ctx: {
+ item?: T
+ wait?: number
+ } = {}
+ ) => {
+ const { item } = ctx
+ const { mutate } = useCart() as any
- return useCallback(
- debounce(async (input: UpdateItemActionInput) => {
- const itemId = input.id ?? item?.id
- const productId = input.productId ?? item?.productId
- const variantId = input.productId ?? item?.variantId
+ return useCallback(
+ debounce(async (input: UpdateItemActionInput) => {
+ const itemId = input.id ?? item?.id
+ const productId = input.productId ?? item?.productId
+ const variantId = input.productId ?? item?.variantId
- if (!itemId || !productId || !variantId) {
- throw new ValidationError({
- message: 'Invalid input used for this operation',
+ if (!itemId || !productId || !variantId) {
+ throw new ValidationError({
+ message: 'Invalid input used for this operation',
+ })
+ }
+
+ const data = await fetch({
+ input: {
+ itemId,
+ item: { productId, variantId, quantity: input.quantity },
+ },
})
- }
-
- const data = await fetch({
- input: {
- itemId,
- item: { productId, variantId, quantity: input.quantity },
- },
- })
- await mutate(data, false)
- return data
- }, ctx.wait ?? 500),
- [fetch, mutate]
- )
- },
+ await mutate(data, false)
+ return data
+ }, ctx.wait ?? 500),
+ [fetch, mutate]
+ )
+ },
}
diff --git a/packages/kibocommerce/src/checkout/use-checkout.tsx b/packages/kibocommerce/src/checkout/use-checkout.tsx
index cab52bb60..76997be73 100644
--- a/packages/kibocommerce/src/checkout/use-checkout.tsx
+++ b/packages/kibocommerce/src/checkout/use-checkout.tsx
@@ -1,5 +1,7 @@
import { SWRHook } from '@vercel/commerce/utils/types'
-import useCheckout, { UseCheckout } from '@vercel/commerce/checkout/use-checkout'
+import useCheckout, {
+ UseCheckout,
+} from '@vercel/commerce/checkout/use-checkout'
export default useCheckout as UseCheckout
diff --git a/packages/kibocommerce/src/commerce.config.json b/packages/kibocommerce/src/commerce.config.json
index cd58f1e29..7b96ac1c2 100644
--- a/packages/kibocommerce/src/commerce.config.json
+++ b/packages/kibocommerce/src/commerce.config.json
@@ -6,4 +6,4 @@
"search": true,
"customerAuth": true
}
-}
\ No newline at end of file
+}
diff --git a/packages/kibocommerce/src/customer/address/use-add-item.tsx b/packages/kibocommerce/src/customer/address/use-add-item.tsx
index fabd11b1d..4f85c8472 100644
--- a/packages/kibocommerce/src/customer/address/use-add-item.tsx
+++ b/packages/kibocommerce/src/customer/address/use-add-item.tsx
@@ -1,4 +1,6 @@
-import useAddItem, { UseAddItem } from '@vercel/commerce/customer/address/use-add-item'
+import useAddItem, {
+ UseAddItem,
+} from '@vercel/commerce/customer/address/use-add-item'
import { MutationHook } from '@vercel/commerce/utils/types'
export default useAddItem as UseAddItem
diff --git a/packages/kibocommerce/src/customer/card/use-add-item.tsx b/packages/kibocommerce/src/customer/card/use-add-item.tsx
index 938e6cd61..77d149eff 100644
--- a/packages/kibocommerce/src/customer/card/use-add-item.tsx
+++ b/packages/kibocommerce/src/customer/card/use-add-item.tsx
@@ -1,4 +1,6 @@
-import useAddItem, { UseAddItem } from '@vercel/commerce/customer/card/use-add-item'
+import useAddItem, {
+ UseAddItem,
+} from '@vercel/commerce/customer/card/use-add-item'
import { MutationHook } from '@vercel/commerce/utils/types'
export default useAddItem as UseAddItem
diff --git a/packages/kibocommerce/src/customer/use-customer.tsx b/packages/kibocommerce/src/customer/use-customer.tsx
index 73e804a4b..0756377ff 100644
--- a/packages/kibocommerce/src/customer/use-customer.tsx
+++ b/packages/kibocommerce/src/customer/use-customer.tsx
@@ -1,5 +1,7 @@
import { SWRHook } from '@vercel/commerce/utils/types'
-import useCustomer, { UseCustomer } from '@vercel/commerce/customer/use-customer'
+import useCustomer, {
+ UseCustomer,
+} from '@vercel/commerce/customer/use-customer'
import type { CustomerHook } from '../types/customer'
export default useCustomer as UseCustomer
@@ -13,12 +15,14 @@ export const handler: SWRHook = {
const data = await fetch(options)
return data?.customer ?? null
},
- useHook: ({ useData }) => (input) => {
- return useData({
- swrOptions: {
- revalidateOnFocus: false,
- ...input?.swrOptions,
- },
- })
- },
+ useHook:
+ ({ useData }) =>
+ (input) => {
+ return useData({
+ swrOptions: {
+ revalidateOnFocus: false,
+ ...input?.swrOptions,
+ },
+ })
+ },
}
diff --git a/packages/kibocommerce/src/index.tsx b/packages/kibocommerce/src/index.tsx
index 43077a535..dbfd66b0b 100644
--- a/packages/kibocommerce/src/index.tsx
+++ b/packages/kibocommerce/src/index.tsx
@@ -1,4 +1,7 @@
-import { getCommerceProvider, useCommerce as useCoreCommerce } from '@vercel/commerce'
+import {
+ getCommerceProvider,
+ useCommerce as useCoreCommerce,
+} from '@vercel/commerce'
import { kiboCommerceProvider, KibocommerceProvider } from './provider'
export { kiboCommerceProvider }
diff --git a/packages/kibocommerce/src/lib/get-cookie-expiration-date.ts b/packages/kibocommerce/src/lib/get-cookie-expiration-date.ts
index 89fd24504..8717ae498 100644
--- a/packages/kibocommerce/src/lib/get-cookie-expiration-date.ts
+++ b/packages/kibocommerce/src/lib/get-cookie-expiration-date.ts
@@ -1,8 +1,10 @@
-export function getCookieExpirationDate(maxAgeInDays: number){
- const today = new Date();
- const expirationDate = new Date();
-
- const cookieExpirationDate = new Date ( expirationDate.setDate(today.getDate() + maxAgeInDays) )
+export function getCookieExpirationDate(maxAgeInDays: number) {
+ const today = new Date()
+ const expirationDate = new Date()
- return cookieExpirationDate;
-}
\ No newline at end of file
+ const cookieExpirationDate = new Date(
+ expirationDate.setDate(today.getDate() + maxAgeInDays)
+ )
+
+ return cookieExpirationDate
+}
diff --git a/packages/kibocommerce/src/lib/normalize.ts b/packages/kibocommerce/src/lib/normalize.ts
index 363589f0f..f6719ee8d 100644
--- a/packages/kibocommerce/src/lib/normalize.ts
+++ b/packages/kibocommerce/src/lib/normalize.ts
@@ -1,5 +1,5 @@
import type { PrCategory, CustomerAccountInput, Document } from '../../schema'
-import { Page } from '../types/page';
+import { Page } from '../types/page'
import { Customer } from '../types/customer'
export function normalizeProduct(productNode: any, config: any): any {
@@ -57,7 +57,7 @@ export function normalizePage(page: Document): Page {
url: page.properties.url,
body: page.properties.body,
is_visible: page.properties.is_visible,
- sort_order: page.properties.sort_order
+ sort_order: page.properties.sort_order,
}
}
@@ -91,7 +91,7 @@ export function normalizeCustomer(customer: CustomerAccountInput): Customer {
lastName: customer.lastName,
email: customer.emailAddress,
userName: customer.userName,
- isAnonymous: customer.isAnonymous
+ isAnonymous: customer.isAnonymous,
}
}
@@ -133,7 +133,7 @@ export function normalizeCategory(category: PrCategory): any {
export function normalizeWishlistItem(
item: any,
config: any,
- includeProducts=false
+ includeProducts = false
): any {
if (includeProducts) {
return {
diff --git a/packages/kibocommerce/src/lib/prepare-set-cookie.ts b/packages/kibocommerce/src/lib/prepare-set-cookie.ts
index c1aeb1c83..e212fefda 100644
--- a/packages/kibocommerce/src/lib/prepare-set-cookie.ts
+++ b/packages/kibocommerce/src/lib/prepare-set-cookie.ts
@@ -1,15 +1,19 @@
-export function prepareSetCookie(name: string, value: string, options: any = {}): string {
+export function prepareSetCookie(
+ name: string,
+ value: string,
+ options: any = {}
+): string {
const encodedValue = Buffer.from(value).toString('base64')
- const cookieValue = [`${name}=${encodedValue}`];
-
+ const cookieValue = [`${name}=${encodedValue}`]
+
if (options.maxAge) {
- cookieValue.push(`Max-Age=${options.maxAge}`);
+ cookieValue.push(`Max-Age=${options.maxAge}`)
}
-
+
if (options.expires && !options.maxAge) {
- cookieValue.push(`Expires=${options.expires.toUTCString()}`);
+ cookieValue.push(`Expires=${options.expires.toUTCString()}`)
}
-
+
const cookie = cookieValue.join('; ')
return cookie
-}
\ No newline at end of file
+}
diff --git a/packages/kibocommerce/src/lib/product-search-vars.ts b/packages/kibocommerce/src/lib/product-search-vars.ts
index 37c4d81eb..f048f3fb7 100644
--- a/packages/kibocommerce/src/lib/product-search-vars.ts
+++ b/packages/kibocommerce/src/lib/product-search-vars.ts
@@ -1,9 +1,9 @@
function getFacetValueFilter(categoryCode: string, filters = []) {
- let facetValueFilter = '';
- if (categoryCode) {
- facetValueFilter = `categoryCode:${categoryCode},`;
- }
- return facetValueFilter + filters.join(',');
+ let facetValueFilter = ''
+ if (categoryCode) {
+ facetValueFilter = `categoryCode:${categoryCode},`
+ }
+ return facetValueFilter + filters.join(',')
}
export const buildProductSearchVars = ({
@@ -14,33 +14,38 @@ export const buildProductSearchVars = ({
sort = '',
search = '',
}) => {
- let facetTemplate = '';
- let filter = '';
- let sortBy;
+ let facetTemplate = ''
+ let filter = ''
+ let sortBy
if (categoryCode) {
- facetTemplate = `categoryCode:${categoryCode}`;
- filter = `categoryCode req ${categoryCode}`;
+ facetTemplate = `categoryCode:${categoryCode}`
+ filter = `categoryCode req ${categoryCode}`
}
- const facetFilterList = Object.keys(filters).filter(k => filters[k].length).reduce((accum, k): any => {
- return [...accum, ...filters[k].map((facetValue: any) => `Tenant~${k}:${facetValue}`)];
- }, []);
+ const facetFilterList = Object.keys(filters)
+ .filter((k) => filters[k].length)
+ .reduce((accum, k): any => {
+ return [
+ ...accum,
+ ...filters[k].map((facetValue: any) => `Tenant~${k}:${facetValue}`),
+ ]
+ }, [])
- const facetValueFilter = getFacetValueFilter(categoryCode, facetFilterList);
+ const facetValueFilter = getFacetValueFilter(categoryCode, facetFilterList)
- switch(sort) {
+ switch (sort) {
case 'latest-desc':
- sortBy= 'createDate desc';
- break;
+ sortBy = 'createDate desc'
+ break
case 'price-asc':
- sortBy= 'price asc';
- break;
+ sortBy = 'price asc'
+ break
case 'price-desc':
- sortBy= 'price desc';
- break;
+ sortBy = 'price desc'
+ break
case 'trending-desc':
default:
- sortBy= '';
- break;
+ sortBy = ''
+ break
}
return {
@@ -50,6 +55,6 @@ export const buildProductSearchVars = ({
sortBy,
filter: filter,
facetTemplate,
- facetValueFilter
+ facetValueFilter,
}
}
diff --git a/packages/kibocommerce/src/lib/set-cookie.ts b/packages/kibocommerce/src/lib/set-cookie.ts
index 2c194c921..a76558c20 100644
--- a/packages/kibocommerce/src/lib/set-cookie.ts
+++ b/packages/kibocommerce/src/lib/set-cookie.ts
@@ -1,3 +1,3 @@
export function setCookies(res: any, cookies: string[]): void {
- res.setHeader('Set-Cookie', cookies);
-}
\ No newline at end of file
+ res.setHeader('Set-Cookie', cookies)
+}
diff --git a/packages/kibocommerce/src/next.config.cjs b/packages/kibocommerce/src/next.config.cjs
index 79a348c88..492be74b6 100644
--- a/packages/kibocommerce/src/next.config.cjs
+++ b/packages/kibocommerce/src/next.config.cjs
@@ -4,9 +4,13 @@ module.exports = {
commerce,
serverRuntimeConfig: {
// Will only be available on the server side
- kiboAuthTicket: null
+ kiboAuthTicket: null,
},
images: {
- domains: ['d1slj7rdbjyb5l.cloudfront.net', 'cdn-tp1.mozu.com', 'cdn-sb.mozu.com'],
+ domains: [
+ 'd1slj7rdbjyb5l.cloudfront.net',
+ 'cdn-tp1.mozu.com',
+ 'cdn-sb.mozu.com',
+ ],
},
}
diff --git a/packages/kibocommerce/src/product/use-search.tsx b/packages/kibocommerce/src/product/use-search.tsx
index 4a9107b4a..7a8ea881f 100644
--- a/packages/kibocommerce/src/product/use-search.tsx
+++ b/packages/kibocommerce/src/product/use-search.tsx
@@ -23,15 +23,17 @@ export const handler: SWRHook = {
method: options.method,
})
},
- useHook: ({ useData }) => (input) => {
- return useData({
- input: [
- ['search', input.search],
- ['categoryId', input.categoryId],
- ['brandId', input.brandId],
- ['sort', input.sort],
- ],
- swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },
- })
- },
+ useHook:
+ ({ useData }) =>
+ (input) => {
+ return useData({
+ input: [
+ ['search', input.search],
+ ['categoryId', input.categoryId],
+ ['brandId', input.brandId],
+ ['sort', input.sort],
+ ],
+ swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },
+ })
+ },
}
diff --git a/packages/kibocommerce/src/provider.ts b/packages/kibocommerce/src/provider.ts
index 8ca1ddfde..0408deff2 100644
--- a/packages/kibocommerce/src/provider.ts
+++ b/packages/kibocommerce/src/provider.ts
@@ -9,7 +9,7 @@ import { handler as useLogin } from './auth/use-login'
import { handler as useLogout } from './auth/use-logout'
import { handler as useSignup } from './auth/use-signup'
import { handler as useWishlist } from './wishlist/use-wishlist'
-import { handler as useWishlistAddItem } from './wishlist/use-add-item'
+import { handler as useWishlistAddItem } from './wishlist/use-add-item'
import { handler as useWishlistRemoveItem } from './wishlist/use-remove-item'
export const kiboCommerceProvider = {
diff --git a/packages/kibocommerce/src/types/customer.ts b/packages/kibocommerce/src/types/customer.ts
index 29f68fef1..3e72fa40d 100644
--- a/packages/kibocommerce/src/types/customer.ts
+++ b/packages/kibocommerce/src/types/customer.ts
@@ -2,26 +2,26 @@ import * as Core from '@vercel/commerce/types/customer'
export type Maybe = T | null
export * from '@vercel/commerce/types/customer'
export type Scalars = {
- ID: string
- String: string
- Boolean: boolean
- Int: number
- Float: number
- /** The `AnyScalar` type allows any scalar value by examining the input and passing the serialize, parseValue, and parseLiteral operations to their respective types. */
- AnyScalar: any
- /** DateTime custom scalar type */
- DateTime: any
- /** Object custom scalar type */
- Object: any
+ ID: string
+ String: string
+ Boolean: boolean
+ Int: number
+ Float: number
+ /** The `AnyScalar` type allows any scalar value by examining the input and passing the serialize, parseValue, and parseLiteral operations to their respective types. */
+ AnyScalar: any
+ /** DateTime custom scalar type */
+ DateTime: any
+ /** Object custom scalar type */
+ Object: any
}
export type Customer = {
- id: Scalars['Int'],
- firstName?: Maybe,
- lastName?: Maybe,
- email?: Maybe,
- userName?: Maybe,
- isAnonymous?: Maybe
+ id: Scalars['Int']
+ firstName?: Maybe
+ lastName?: Maybe
+ email?: Maybe
+ userName?: Maybe
+ isAnonymous?: Maybe
}
export type CustomerSchema = Core.CustomerSchema
diff --git a/packages/kibocommerce/src/types/page.ts b/packages/kibocommerce/src/types/page.ts
index f311eb8b8..4b9df3f7e 100644
--- a/packages/kibocommerce/src/types/page.ts
+++ b/packages/kibocommerce/src/types/page.ts
@@ -1,17 +1,17 @@
import * as Core from '@vercel/commerce/types/page'
export type Maybe = T | null
export type Scalars = {
- ID: string
- String: string
- Boolean: boolean
- Int: number
- Float: number
- /** The `AnyScalar` type allows any scalar value by examining the input and passing the serialize, parseValue, and parseLiteral operations to their respective types. */
- AnyScalar: any
- /** DateTime custom scalar type */
- DateTime: any
- /** Object custom scalar type */
- Object: any
+ ID: string
+ String: string
+ Boolean: boolean
+ Int: number
+ Float: number
+ /** The `AnyScalar` type allows any scalar value by examining the input and passing the serialize, parseValue, and parseLiteral operations to their respective types. */
+ AnyScalar: any
+ /** DateTime custom scalar type */
+ DateTime: any
+ /** Object custom scalar type */
+ Object: any
}
export * from '@vercel/commerce/types/page'
@@ -19,16 +19,16 @@ export * from '@vercel/commerce/types/page'
export type Page = Core.Page
export type PageTypes = {
- page: Page
+ page: Page
}
export type GetPagesQueryParams = {
- documentListName: Maybe
+ documentListName: Maybe
}
export type GetPageQueryParams = {
- id: Maybe
- documentListName: Maybe
+ id: Maybe
+ documentListName: Maybe
}
export type GetAllPagesOperation = Core.GetAllPagesOperation
diff --git a/packages/kibocommerce/src/wishlist/use-wishlist.tsx b/packages/kibocommerce/src/wishlist/use-wishlist.tsx
index a91eb419b..825feb415 100644
--- a/packages/kibocommerce/src/wishlist/use-wishlist.tsx
+++ b/packages/kibocommerce/src/wishlist/use-wishlist.tsx
@@ -1,6 +1,8 @@
import { useMemo } from 'react'
import { SWRHook } from '@vercel/commerce/utils/types'
-import useWishlist, { UseWishlist } from '@vercel/commerce/wishlist/use-wishlist'
+import useWishlist, {
+ UseWishlist,
+} from '@vercel/commerce/wishlist/use-wishlist'
import type { GetWishlistHook } from '@vercel/commerce/types/wishlist'
import useCustomer from '../customer/use-customer'
@@ -11,42 +13,44 @@ export const handler: SWRHook = {
url: '/api/wishlist',
method: 'GET',
},
- fetcher({ input: { customerId, includeProducts}, options, fetch }) {
+ fetcher({ input: { customerId, includeProducts }, options, fetch }) {
if (!customerId) return null
// Use a dummy base as we only care about the relative path
const url = new URL(options.url!, 'http://a')
if (includeProducts) url.searchParams.set('products', '1')
- if(customerId) url.searchParams.set('customerId', customerId)
+ if (customerId) url.searchParams.set('customerId', customerId)
return fetch({
url: url.pathname + url.search,
method: options.method,
})
},
- useHook: ({ useData }) => (input) => {
- const { data: customer } = useCustomer()
- const response = useData({
- input: [
- ['customerId', customer?.id],
- ['includeProducts', input?.includeProducts],
- ],
- swrOptions: {
- revalidateOnFocus: false,
- ...input?.swrOptions,
- },
- })
- return useMemo(
- () =>
- Object.create(response, {
- isEmpty: {
- get() {
- return (response.data?.items?.length || 0) <= 0
+ useHook:
+ ({ useData }) =>
+ (input) => {
+ const { data: customer } = useCustomer()
+ const response = useData({
+ input: [
+ ['customerId', customer?.id],
+ ['includeProducts', input?.includeProducts],
+ ],
+ swrOptions: {
+ revalidateOnFocus: false,
+ ...input?.swrOptions,
+ },
+ })
+ return useMemo(
+ () =>
+ Object.create(response, {
+ isEmpty: {
+ get() {
+ return (response.data?.items?.length || 0) <= 0
+ },
+ enumerable: true,
},
- enumerable: true,
- },
- }),
- [response]
- )
- },
+ }),
+ [response]
+ )
+ },
}
diff --git a/packages/ordercloud/src/api/operations/get-site-info.ts b/packages/ordercloud/src/api/operations/get-site-info.ts
index ec0ed5dd3..953bcb385 100644
--- a/packages/ordercloud/src/api/operations/get-site-info.ts
+++ b/packages/ordercloud/src/api/operations/get-site-info.ts
@@ -1,5 +1,8 @@
import type { OperationContext } from '@vercel/commerce/api/operations'
-import type { Category, GetSiteInfoOperation } from '@vercel/commerce/types/site'
+import type {
+ Category,
+ GetSiteInfoOperation,
+} from '@vercel/commerce/types/site'
import type { RawCategory } from '../../types/category'
import type { OrdercloudConfig, Provider } from '../index'
diff --git a/packages/ordercloud/src/api/utils/fetch-rest.ts b/packages/ordercloud/src/api/utils/fetch-rest.ts
index 5b70b9dff..445eb37a2 100644
--- a/packages/ordercloud/src/api/utils/fetch-rest.ts
+++ b/packages/ordercloud/src/api/utils/fetch-rest.ts
@@ -1,6 +1,6 @@
import vercelFetch from '@vercel/fetch'
import { FetcherError } from '@vercel/commerce/utils/errors'
-import { CustomNodeJsGlobal } from '../../types/node';
+import { CustomNodeJsGlobal } from '../../types/node'
import { OrdercloudConfig } from '../index'
@@ -144,12 +144,11 @@ export const createBuyerFetcher: (
body?: Record,
fetchOptions?: Record
) => {
- const customGlobal = global as unknown as CustomNodeJsGlobal;
+ const customGlobal = global as unknown as CustomNodeJsGlobal
// Get provider config
const config = getConfig()
-
// If a token was passed, set it on global
if (fetchOptions?.token) {
customGlobal.token = fetchOptions.token
diff --git a/packages/ordercloud/src/cart/use-remove-item.tsx b/packages/ordercloud/src/cart/use-remove-item.tsx
index fba15f8d5..1865fd7ed 100644
--- a/packages/ordercloud/src/cart/use-remove-item.tsx
+++ b/packages/ordercloud/src/cart/use-remove-item.tsx
@@ -2,12 +2,18 @@ import type {
MutationHookContext,
HookFetcherContext,
} from '@vercel/commerce/utils/types'
-import type { Cart, LineItem, RemoveItemHook } from '@vercel/commerce/types/cart'
+import type {
+ Cart,
+ LineItem,
+ RemoveItemHook,
+} from '@vercel/commerce/types/cart'
import { useCallback } from 'react'
import { ValidationError } from '@vercel/commerce/utils/errors'
-import useRemoveItem, { UseRemoveItem } from '@vercel/commerce/cart/use-remove-item'
+import useRemoveItem, {
+ UseRemoveItem,
+} from '@vercel/commerce/cart/use-remove-item'
import useCart from './use-cart'
diff --git a/packages/ordercloud/src/cart/use-update-item.tsx b/packages/ordercloud/src/cart/use-update-item.tsx
index 7a5f6fcf7..55a3bcb91 100644
--- a/packages/ordercloud/src/cart/use-update-item.tsx
+++ b/packages/ordercloud/src/cart/use-update-item.tsx
@@ -9,7 +9,9 @@ import debounce from 'lodash.debounce'
import { MutationHook } from '@vercel/commerce/utils/types'
import { ValidationError } from '@vercel/commerce/utils/errors'
-import useUpdateItem, { UseUpdateItem } from '@vercel/commerce/cart/use-update-item'
+import useUpdateItem, {
+ UseUpdateItem,
+} from '@vercel/commerce/cart/use-update-item'
import { handler as removeItemHandler } from './use-remove-item'
import useCart from './use-cart'
diff --git a/packages/ordercloud/src/checkout/use-checkout.tsx b/packages/ordercloud/src/checkout/use-checkout.tsx
index f60ebfdd9..fdb0024ee 100644
--- a/packages/ordercloud/src/checkout/use-checkout.tsx
+++ b/packages/ordercloud/src/checkout/use-checkout.tsx
@@ -2,7 +2,9 @@ import type { GetCheckoutHook } from '@vercel/commerce/types/checkout'
import { useMemo } from 'react'
import { SWRHook } from '@vercel/commerce/utils/types'
-import useCheckout, { UseCheckout } from '@vercel/commerce/checkout/use-checkout'
+import useCheckout, {
+ UseCheckout,
+} from '@vercel/commerce/checkout/use-checkout'
import useSubmitCheckout from './use-submit-checkout'
export default useCheckout as UseCheckout
diff --git a/packages/ordercloud/src/customer/address/use-add-item.tsx b/packages/ordercloud/src/customer/address/use-add-item.tsx
index 798f5fe22..cb808a5a1 100644
--- a/packages/ordercloud/src/customer/address/use-add-item.tsx
+++ b/packages/ordercloud/src/customer/address/use-add-item.tsx
@@ -2,7 +2,9 @@ import type { AddItemHook } from '@vercel/commerce/types/customer/address'
import type { MutationHook } from '@vercel/commerce/utils/types'
import { useCallback } from 'react'
-import useAddItem, { UseAddItem } from '@vercel/commerce/customer/address/use-add-item'
+import useAddItem, {
+ UseAddItem,
+} from '@vercel/commerce/customer/address/use-add-item'
import useAddresses from './use-addresses'
export default useAddItem as UseAddItem
diff --git a/packages/ordercloud/src/customer/address/use-remove-item.tsx b/packages/ordercloud/src/customer/address/use-remove-item.tsx
index ac805dbc5..f5945749d 100644
--- a/packages/ordercloud/src/customer/address/use-remove-item.tsx
+++ b/packages/ordercloud/src/customer/address/use-remove-item.tsx
@@ -2,7 +2,10 @@ import type {
MutationHookContext,
HookFetcherContext,
} from '@vercel/commerce/utils/types'
-import type { Address, RemoveItemHook } from '@vercel/commerce/types/customer/address'
+import type {
+ Address,
+ RemoveItemHook,
+} from '@vercel/commerce/types/customer/address'
import { useCallback } from 'react'
diff --git a/packages/ordercloud/src/customer/address/use-update-item.tsx b/packages/ordercloud/src/customer/address/use-update-item.tsx
index d65956b7b..ff847cecd 100644
--- a/packages/ordercloud/src/customer/address/use-update-item.tsx
+++ b/packages/ordercloud/src/customer/address/use-update-item.tsx
@@ -2,7 +2,10 @@ import type {
HookFetcherContext,
MutationHookContext,
} from '@vercel/commerce/utils/types'
-import type { UpdateItemHook, Address } from '@vercel/commerce/types/customer/address'
+import type {
+ UpdateItemHook,
+ Address,
+} from '@vercel/commerce/types/customer/address'
import { useCallback } from 'react'
diff --git a/packages/ordercloud/src/customer/card/use-add-item.tsx b/packages/ordercloud/src/customer/card/use-add-item.tsx
index 8e7d27885..f7c1bcec9 100644
--- a/packages/ordercloud/src/customer/card/use-add-item.tsx
+++ b/packages/ordercloud/src/customer/card/use-add-item.tsx
@@ -2,7 +2,9 @@ import type { AddItemHook } from '@vercel/commerce/types/customer/card'
import type { MutationHook } from '@vercel/commerce/utils/types'
import { useCallback } from 'react'
-import useAddItem, { UseAddItem } from '@vercel/commerce/customer/card/use-add-item'
+import useAddItem, {
+ UseAddItem,
+} from '@vercel/commerce/customer/card/use-add-item'
import useCards from './use-cards'
export default useAddItem as UseAddItem
diff --git a/packages/ordercloud/src/customer/use-customer.tsx b/packages/ordercloud/src/customer/use-customer.tsx
index 6eaede14f..04c48943d 100644
--- a/packages/ordercloud/src/customer/use-customer.tsx
+++ b/packages/ordercloud/src/customer/use-customer.tsx
@@ -1,5 +1,7 @@
import { SWRHook } from '@vercel/commerce/utils/types'
-import useCustomer, { UseCustomer } from '@vercel/commerce/customer/use-customer'
+import useCustomer, {
+ UseCustomer,
+} from '@vercel/commerce/customer/use-customer'
export default useCustomer as UseCustomer
export const handler: SWRHook = {
diff --git a/packages/ordercloud/src/index.tsx b/packages/ordercloud/src/index.tsx
index b282942e8..50f078407 100644
--- a/packages/ordercloud/src/index.tsx
+++ b/packages/ordercloud/src/index.tsx
@@ -1,5 +1,8 @@
import { ordercloudProvider, OrdercloudProvider } from './provider'
-import { getCommerceProvider, useCommerce as useCoreCommerce } from '@vercel/commerce'
+import {
+ getCommerceProvider,
+ useCommerce as useCoreCommerce,
+} from '@vercel/commerce'
export { ordercloudProvider }
export type { OrdercloudProvider }
diff --git a/packages/saleor/schema.d.ts b/packages/saleor/schema.d.ts
index 339e7269d..ae392549a 100644
--- a/packages/saleor/schema.d.ts
+++ b/packages/saleor/schema.d.ts
@@ -2,8 +2,12 @@ export type Maybe = T | null
export type Exact = {
[K in keyof T]: T[K]
}
-export type MakeOptional = Omit & { [SubKey in K]?: Maybe }
-export type MakeMaybe = Omit & { [SubKey in K]: Maybe }
+export type MakeOptional = Omit & {
+ [SubKey in K]?: Maybe
+}
+export type MakeMaybe = Omit & {
+ [SubKey in K]: Maybe
+}
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string
@@ -11440,9 +11444,15 @@ export type GetAllProductPathsQueryVariables = Exact<{
export type GetAllProductPathsQuery = { __typename?: 'Query' } & {
products?: Maybe<
{ __typename?: 'ProductCountableConnection' } & {
- pageInfo: { __typename?: 'PageInfo' } & Pick
+ pageInfo: { __typename?: 'PageInfo' } & Pick<
+ PageInfo,
+ 'hasNextPage' | 'hasPreviousPage'
+ >
edges: Array<
- { __typename?: 'ProductCountableEdge' } & Pick & {
+ { __typename?: 'ProductCountableEdge' } & Pick<
+ ProductCountableEdge,
+ 'cursor'
+ > & {
node: { __typename?: 'Product' } & Pick
}
>
@@ -11453,10 +11463,16 @@ export type GetAllProductPathsQuery = { __typename?: 'Query' } & {
export type ProductConnectionFragment = {
__typename?: 'ProductCountableConnection'
} & {
- pageInfo: { __typename?: 'PageInfo' } & Pick
+ pageInfo: { __typename?: 'PageInfo' } & Pick<
+ PageInfo,
+ 'hasNextPage' | 'hasPreviousPage'
+ >
edges: Array<
{ __typename?: 'ProductCountableEdge' } & {
- node: { __typename?: 'Product' } & Pick & {
+ node: { __typename?: 'Product' } & Pick<
+ Product,
+ 'id' | 'name' | 'description' | 'slug'
+ > & {
pricing?: Maybe<
{ __typename?: 'ProductPricingInfo' } & {
priceRange?: Maybe<
@@ -11470,7 +11486,14 @@ export type ProductConnectionFragment = {
>
}
>
- media?: Maybe>>
+ media?: Maybe<
+ Array<
+ { __typename?: 'ProductMedia' } & Pick<
+ ProductMedia,
+ 'url' | 'alt'
+ >
+ >
+ >
}
}
>
@@ -11484,5 +11507,7 @@ export type GetAllProductsQueryVariables = Exact<{
}>
export type GetAllProductsQuery = { __typename?: 'Query' } & {
- products?: Maybe<{ __typename?: 'ProductCountableConnection' } & ProductConnectionFragment>
+ products?: Maybe<
+ { __typename?: 'ProductCountableConnection' } & ProductConnectionFragment
+ >
}
diff --git a/packages/saleor/schema.graphql b/packages/saleor/schema.graphql
index de2858641..aa5c7c263 100644
--- a/packages/saleor/schema.graphql
+++ b/packages/saleor/schema.graphql
@@ -7,7 +7,9 @@ type AccountAddressCreate {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
address: Address
}
@@ -21,7 +23,9 @@ type AccountAddressDelete {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
address: Address
}
@@ -35,7 +39,9 @@ type AccountAddressUpdate {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
address: Address
}
@@ -45,7 +51,9 @@ Remove user account.
"""
type AccountDelete {
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
user: User
}
@@ -146,7 +154,9 @@ type AccountRegister {
"""
requiresConfirmation: Boolean
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
user: User
}
@@ -188,7 +198,9 @@ Sends an email with the account removal link for the logged-in user.
"""
type AccountRequestDeletion {
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -201,7 +213,9 @@ type AccountSetDefaultAddress {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -210,7 +224,9 @@ Updates the account of the logged-in user.
"""
type AccountUpdate {
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
user: User
}
@@ -259,7 +275,9 @@ type AddressCreate {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
address: Address
}
@@ -273,7 +291,9 @@ type AddressDelete {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
address: Address
}
@@ -344,7 +364,9 @@ type AddressSetDefault {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -365,7 +387,9 @@ type AddressUpdate {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
address: Address
}
@@ -514,7 +538,10 @@ type App implements Node & ObjectWithMetadata {
Activate the app.
"""
type AppActivate {
- appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ appErrors: [AppError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AppError!]!
app: App
}
@@ -552,7 +579,10 @@ type AppCreate {
The newly created authentication token.
"""
authToken: String
- appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ appErrors: [AppError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AppError!]!
app: App
}
@@ -561,7 +591,10 @@ type AppCreate {
Deactivate the app.
"""
type AppDeactivate {
- appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ appErrors: [AppError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AppError!]!
app: App
}
@@ -570,7 +603,10 @@ type AppDeactivate {
Deletes an app.
"""
type AppDelete {
- appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ appErrors: [AppError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AppError!]!
app: App
}
@@ -579,7 +615,10 @@ type AppDelete {
Delete failed installation.
"""
type AppDeleteFailedInstallation {
- appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ appErrors: [AppError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AppError!]!
appInstallation: AppInstallation
}
@@ -630,7 +669,10 @@ Fetch and validate manifest.
"""
type AppFetchManifest {
manifest: Manifest
- appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ appErrors: [AppError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AppError!]!
}
@@ -656,7 +698,10 @@ input AppInput {
Install new app by using app manifest.
"""
type AppInstall {
- appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ appErrors: [AppError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AppError!]!
appInstallation: AppInstallation
}
@@ -720,7 +765,10 @@ type AppInstallation implements Node & Job {
Retry failed installation of new app.
"""
type AppRetryInstall {
- appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ appErrors: [AppError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AppError!]!
appInstallation: AppInstallation
}
@@ -777,7 +825,10 @@ type AppTokenCreate {
The newly created authentication token.
"""
authToken: String
- appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ appErrors: [AppError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AppError!]!
appToken: AppToken
}
@@ -786,7 +837,10 @@ type AppTokenCreate {
Deletes an authentication token assigned to app.
"""
type AppTokenDelete {
- appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ appErrors: [AppError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AppError!]!
appToken: AppToken
}
@@ -811,7 +865,10 @@ type AppTokenVerify {
Determine if token is valid or not.
"""
valid: Boolean!
- appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ appErrors: [AppError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AppError!]!
}
@@ -834,7 +891,10 @@ enum AppTypeEnum {
Updates an existing app.
"""
type AppUpdate {
- appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ appErrors: [AppError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AppError!]!
app: App
}
@@ -859,7 +919,10 @@ type AssignNavigation {
Assigned navigation menu.
"""
menu: Menu
- menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ menuErrors: [MenuError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MenuError!]!
}
@@ -871,8 +934,18 @@ type Attribute implements Node & ObjectWithMetadata {
The ID of the object.
"""
id: ID!
- productTypes(before: String, after: String, first: Int, last: Int): ProductTypeCountableConnection!
- productVariantTypes(before: String, after: String, first: Int, last: Int): ProductTypeCountableConnection!
+ productTypes(
+ before: String
+ after: String
+ first: Int
+ last: Int
+ ): ProductTypeCountableConnection!
+ productVariantTypes(
+ before: String
+ after: String
+ first: Int
+ last: Int
+ ): ProductTypeCountableConnection!
"""
List of private metadata items.Requires proper staff permissions to access.
@@ -969,7 +1042,9 @@ type AttributeBulkDelete {
"""
count: Int!
attributeErrors: [AttributeError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AttributeError!]!
}
@@ -1004,7 +1079,9 @@ Creates an attribute.
type AttributeCreate {
attribute: Attribute
attributeErrors: [AttributeError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AttributeError!]!
}
@@ -1085,7 +1162,9 @@ Deletes an attribute.
"""
type AttributeDelete {
attributeErrors: [AttributeError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AttributeError!]!
attribute: Attribute
}
@@ -1185,7 +1264,9 @@ type AttributeReorderValues {
"""
attribute: Attribute
attributeErrors: [AttributeError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AttributeError!]!
}
@@ -1276,7 +1357,9 @@ Creates/Updates translations for attribute.
"""
type AttributeTranslate {
translationErrors: [TranslationError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [TranslationError!]!
attribute: Attribute
}
@@ -1308,7 +1391,9 @@ Updates attribute.
type AttributeUpdate {
attribute: Attribute
attributeErrors: [AttributeError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AttributeError!]!
}
@@ -1438,7 +1523,9 @@ type AttributeValueBulkDelete {
"""
count: Int!
attributeErrors: [AttributeError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AttributeError!]!
}
@@ -1451,7 +1538,9 @@ type AttributeValueCreate {
"""
attribute: Attribute
attributeErrors: [AttributeError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AttributeError!]!
attributeValue: AttributeValue
}
@@ -1482,7 +1571,9 @@ type AttributeValueDelete {
"""
attribute: Attribute
attributeErrors: [AttributeError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AttributeError!]!
attributeValue: AttributeValue
}
@@ -1547,7 +1638,9 @@ Creates/Updates translations for attribute value.
"""
type AttributeValueTranslate {
translationErrors: [TranslationError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [TranslationError!]!
attributeValue: AttributeValue
}
@@ -1580,7 +1673,9 @@ type AttributeValueUpdate {
"""
attribute: Attribute
attributeErrors: [AttributeError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AttributeError!]!
attributeValue: AttributeValue
}
@@ -1717,7 +1812,10 @@ type Category implements Node & ObjectWithMetadata {
"""
Description of the category (JSON).
"""
- descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
+ descriptionJson: JSONString
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `description` field instead."
+ )
"""
List of ancestors of the category.
@@ -1825,7 +1923,9 @@ type CategoryBulkDelete {
"""
count: Int!
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -1859,7 +1959,9 @@ Creates a new category.
"""
type CategoryCreate {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
category: Category
}
@@ -1869,7 +1971,9 @@ Deletes a category.
"""
type CategoryDelete {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
category: Category
}
@@ -1959,7 +2063,10 @@ type CategoryTranslatableContent implements Node {
"""
Description of the category (JSON).
"""
- descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
+ descriptionJson: JSONString
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `description` field instead."
+ )
"""
Returns translated category fields for the given language code.
@@ -1982,7 +2089,9 @@ Creates/Updates translations for Category.
"""
type CategoryTranslate {
translationErrors: [TranslationError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [TranslationError!]!
category: Category
}
@@ -2005,7 +2114,10 @@ type CategoryTranslation implements Node {
"""
Translated description of the product (JSON).
"""
- descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
+ descriptionJson: JSONString
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `description` field instead."
+ )
}
"""
@@ -2013,7 +2125,9 @@ Updates a category.
"""
type CategoryUpdate {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
category: Category
}
@@ -2046,7 +2160,9 @@ type ChannelActivate {
"""
channel: Channel
channelErrors: [ChannelError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ChannelError!]!
}
@@ -2055,7 +2171,9 @@ Creates new channel.
"""
type ChannelCreate {
channelErrors: [ChannelError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ChannelError!]!
channel: Channel
}
@@ -2096,7 +2214,9 @@ type ChannelDeactivate {
"""
channel: Channel
channelErrors: [ChannelError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ChannelError!]!
}
@@ -2105,7 +2225,9 @@ Delete a channel. Orders associated with the deleted channel will be moved to th
"""
type ChannelDelete {
channelErrors: [ChannelError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ChannelError!]!
channel: Channel
}
@@ -2160,7 +2282,9 @@ Update a channel.
"""
type ChannelUpdate {
channelErrors: [ChannelError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ChannelError!]!
channel: Channel
}
@@ -2298,7 +2422,9 @@ type CheckoutAddPromoCode {
"""
checkout: Checkout
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2311,7 +2437,9 @@ type CheckoutBillingAddressUpdate {
"""
checkout: Checkout
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2334,7 +2462,9 @@ type CheckoutComplete {
"""
confirmationData: JSONString
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2372,7 +2502,9 @@ type CheckoutCreate {
"""
created: Boolean
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
checkout: Checkout
}
@@ -2418,7 +2550,9 @@ type CheckoutCustomerAttach {
"""
checkout: Checkout
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2431,7 +2565,9 @@ type CheckoutCustomerDetach {
"""
checkout: Checkout
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2444,7 +2580,9 @@ type CheckoutEmailUpdate {
"""
checkout: Checkout
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2513,7 +2651,9 @@ type CheckoutLanguageCodeUpdate {
"""
checkout: Checkout
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2573,7 +2713,9 @@ type CheckoutLineDelete {
"""
checkout: Checkout
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2598,7 +2740,9 @@ type CheckoutLinesAdd {
"""
checkout: Checkout
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2611,7 +2755,9 @@ type CheckoutLinesUpdate {
"""
checkout: Checkout
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2629,7 +2775,9 @@ type CheckoutPaymentCreate {
"""
payment: Payment
paymentErrors: [PaymentError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PaymentError!]!
}
@@ -2642,7 +2790,9 @@ type CheckoutRemovePromoCode {
"""
checkout: Checkout
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2655,7 +2805,9 @@ type CheckoutShippingAddressUpdate {
"""
checkout: Checkout
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2668,7 +2820,9 @@ type CheckoutShippingMethodUpdate {
"""
checkout: Checkout
checkoutErrors: [CheckoutError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CheckoutError!]!
}
@@ -2704,7 +2858,10 @@ type Collection implements Node & ObjectWithMetadata {
"""
Description of the collection (JSON).
"""
- descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
+ descriptionJson: JSONString
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `description` field instead."
+ )
"""
List of products in this collection.
@@ -2772,7 +2929,9 @@ type CollectionAddProducts {
"""
collection: Collection
collectionErrors: [CollectionError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CollectionError!]!
}
@@ -2785,7 +2944,9 @@ type CollectionBulkDelete {
"""
count: Int!
collectionErrors: [CollectionError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CollectionError!]!
}
@@ -2843,7 +3004,9 @@ type CollectionChannelListingUpdate {
"""
collection: Collection
collectionChannelListingErrors: [CollectionChannelListingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CollectionChannelListingError!]!
}
@@ -2889,7 +3052,9 @@ Creates a new collection.
"""
type CollectionCreate {
collectionErrors: [CollectionError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CollectionError!]!
collection: Collection
}
@@ -2946,7 +3111,9 @@ Deletes a collection.
"""
type CollectionDelete {
collectionErrors: [CollectionError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CollectionError!]!
collection: Collection
}
@@ -3054,7 +3221,9 @@ type CollectionRemoveProducts {
"""
collection: Collection
collectionErrors: [CollectionError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CollectionError!]!
}
@@ -3067,7 +3236,9 @@ type CollectionReorderProducts {
"""
collection: Collection
collectionErrors: [CollectionError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CollectionError!]!
}
@@ -3123,7 +3294,10 @@ type CollectionTranslatableContent implements Node {
"""
Description of the collection (JSON).
"""
- descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
+ descriptionJson: JSONString
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `description` field instead."
+ )
"""
Returns translated collection fields for the given language code.
@@ -3146,7 +3320,9 @@ Creates/Updates translations for collection.
"""
type CollectionTranslate {
translationErrors: [TranslationError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [TranslationError!]!
collection: Collection
}
@@ -3169,7 +3345,10 @@ type CollectionTranslation implements Node {
"""
Translated description of the product (JSON).
"""
- descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
+ descriptionJson: JSONString
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `description` field instead."
+ )
}
"""
@@ -3177,7 +3356,9 @@ Updates a collection.
"""
type CollectionUpdate {
collectionErrors: [CollectionError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [CollectionError!]!
collection: Collection
}
@@ -3246,7 +3427,9 @@ type ConfirmAccount {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -3259,7 +3442,9 @@ type ConfirmEmailChange {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -3560,7 +3745,9 @@ type CreateToken {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -3600,7 +3787,9 @@ type CustomerBulkDelete {
"""
count: Int!
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -3609,7 +3798,9 @@ Creates a new customer.
"""
type CustomerCreate {
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
user: User
}
@@ -3619,7 +3810,9 @@ Deletes a customer.
"""
type CustomerDelete {
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
user: User
}
@@ -3742,7 +3935,9 @@ Updates an existing customer.
"""
type CustomerUpdate {
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
user: User
}
@@ -3790,7 +3985,9 @@ Deactivate all JWT tokens of the currently authenticated user.
"""
type DeactivateAllUserTokens {
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -3799,7 +3996,9 @@ Delete metadata of an object.
"""
type DeleteMetadata {
metadataErrors: [MetadataError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MetadataError!]!
item: ObjectWithMetadata
}
@@ -3809,7 +4008,9 @@ Delete object's private metadata.
"""
type DeletePrivateMetadata {
metadataErrors: [MetadataError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MetadataError!]!
item: ObjectWithMetadata
}
@@ -3879,7 +4080,9 @@ type DigitalContentCreate {
variant: ProductVariant
content: DigitalContent
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -3889,7 +4092,9 @@ Remove digital content assigned to given variant.
type DigitalContentDelete {
variant: ProductVariant
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -3922,7 +4127,9 @@ type DigitalContentUpdate {
variant: ProductVariant
content: DigitalContent
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -3979,7 +4186,9 @@ Generate new URL to digital content.
"""
type DigitalContentUrlCreate {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
digitalContentUrl: DigitalContentUrl
}
@@ -4083,7 +4292,10 @@ type DraftOrderBulkDelete {
Returns how many objects were affected.
"""
count: Int!
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -4095,7 +4307,10 @@ type DraftOrderComplete {
Completed order.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -4103,7 +4318,10 @@ type DraftOrderComplete {
Creates a new draft order.
"""
type DraftOrderCreate {
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
order: Order
}
@@ -4165,7 +4383,10 @@ input DraftOrderCreateInput {
Deletes a draft order.
"""
type DraftOrderDelete {
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
order: Order
}
@@ -4226,7 +4447,10 @@ type DraftOrderLinesBulkDelete {
Returns how many objects were affected.
"""
count: Int!
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -4234,7 +4458,10 @@ type DraftOrderLinesBulkDelete {
Updates a draft order.
"""
type DraftOrderUpdate {
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
order: Order
}
@@ -4447,7 +4674,9 @@ type ExportProducts {
"""
exportFile: ExportFile
exportErrors: [ExportError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ExportError!]!
}
@@ -4516,7 +4745,9 @@ type ExternalAuthenticationUrl {
"""
authenticationData: JSONString
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -4529,7 +4760,9 @@ type ExternalLogout {
"""
logoutData: JSONString
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -4557,7 +4790,9 @@ type ExternalObtainAccessTokens {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -4585,7 +4820,9 @@ type ExternalRefresh {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -4608,7 +4845,9 @@ type ExternalVerify {
"""
verifyData: JSONString
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -4638,7 +4877,9 @@ Upload a file. This mutation must be sent as a `multipart` request. More detaile
type FileUpload {
uploadedFile: File
uploadErrors: [UploadError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [UploadError!]!
}
@@ -4694,7 +4935,10 @@ type FulfillmentCancel {
Order which fulfillment was cancelled.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -4730,7 +4974,10 @@ type FulfillmentRefundProducts {
Order which fulfillment was refunded.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -4757,7 +5004,10 @@ type FulfillmentReturnProducts {
A draft order which was created for products with replace flag.
"""
replaceOrder: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -4809,7 +5059,10 @@ type FulfillmentUpdateTracking {
Order for which fulfillment was updated.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -4888,7 +5141,9 @@ type GiftCardActivate {
"""
giftCard: GiftCard
giftCardErrors: [GiftCardError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [GiftCardError!]!
}
@@ -4922,7 +5177,9 @@ Creates a new gift card.
"""
type GiftCardCreate {
giftCardErrors: [GiftCardError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [GiftCardError!]!
giftCard: GiftCard
}
@@ -4963,7 +5220,9 @@ type GiftCardDeactivate {
"""
giftCard: GiftCard
giftCardErrors: [GiftCardError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [GiftCardError!]!
}
@@ -5001,7 +5260,9 @@ Update a gift card.
"""
type GiftCardUpdate {
giftCardErrors: [GiftCardError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [GiftCardError!]!
giftCard: GiftCard
}
@@ -5158,7 +5419,9 @@ Creates a ready to send invoice.
"""
type InvoiceCreate {
invoiceErrors: [InvoiceError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [InvoiceError!]!
invoice: Invoice
}
@@ -5180,7 +5443,9 @@ Deletes an invoice.
"""
type InvoiceDelete {
invoiceErrors: [InvoiceError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [InvoiceError!]!
invoice: Invoice
}
@@ -5224,7 +5489,9 @@ type InvoiceRequest {
"""
order: Order
invoiceErrors: [InvoiceError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [InvoiceError!]!
invoice: Invoice
}
@@ -5234,7 +5501,9 @@ Requests deletion of an invoice.
"""
type InvoiceRequestDelete {
invoiceErrors: [InvoiceError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [InvoiceError!]!
invoice: Invoice
}
@@ -5244,7 +5513,9 @@ Send an invoice notification to the customer.
"""
type InvoiceSendNotification {
invoiceErrors: [InvoiceError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [InvoiceError!]!
invoice: Invoice
}
@@ -5254,7 +5525,9 @@ Updates an invoice.
"""
type InvoiceUpdate {
invoiceErrors: [InvoiceError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [InvoiceError!]!
invoice: Invoice
}
@@ -5476,7 +5749,10 @@ type MenuBulkDelete {
Returns how many objects were affected.
"""
count: Int!
- menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ menuErrors: [MenuError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MenuError!]!
}
@@ -5509,7 +5785,10 @@ type MenuCountableEdge {
Creates a new Menu.
"""
type MenuCreate {
- menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ menuErrors: [MenuError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MenuError!]!
menu: Menu
}
@@ -5535,7 +5814,10 @@ input MenuCreateInput {
Deletes a menu.
"""
type MenuDelete {
- menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ menuErrors: [MenuError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MenuError!]!
menu: Menu
}
@@ -5641,7 +5923,10 @@ type MenuItemBulkDelete {
Returns how many objects were affected.
"""
count: Int!
- menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ menuErrors: [MenuError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MenuError!]!
}
@@ -5674,7 +5959,10 @@ type MenuItemCountableEdge {
Creates a new menu item.
"""
type MenuItemCreate {
- menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ menuErrors: [MenuError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MenuError!]!
menuItem: MenuItem
}
@@ -5720,7 +6008,10 @@ input MenuItemCreateInput {
Deletes a menu item.
"""
type MenuItemDelete {
- menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ menuErrors: [MenuError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MenuError!]!
menuItem: MenuItem
}
@@ -5765,7 +6056,10 @@ type MenuItemMove {
Assigned menu to move within.
"""
menu: Menu
- menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ menuErrors: [MenuError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MenuError!]!
}
@@ -5826,7 +6120,9 @@ Creates/Updates translations for Menu Item.
"""
type MenuItemTranslate {
translationErrors: [TranslationError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [TranslationError!]!
menuItem: MenuItem
}
@@ -5848,7 +6144,10 @@ type MenuItemTranslation implements Node {
Updates a menu item.
"""
type MenuItemUpdate {
- menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ menuErrors: [MenuError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MenuError!]!
menuItem: MenuItem
}
@@ -5888,7 +6187,10 @@ input MenuSortingInput {
Updates a menu.
"""
type MenuUpdate {
- menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ menuErrors: [MenuError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MenuError!]!
menu: Menu
}
@@ -9525,17 +9827,26 @@ type Order implements Node & ObjectWithMetadata {
"""
Returns applied discount.
"""
- discount: Money @deprecated(reason: "Use discounts field. This field will be removed in Saleor 4.0.")
+ discount: Money
+ @deprecated(
+ reason: "Use discounts field. This field will be removed in Saleor 4.0."
+ )
"""
Discount name.
"""
- discountName: String @deprecated(reason: "Use discounts field. This field will be removed in Saleor 4.0.")
+ discountName: String
+ @deprecated(
+ reason: "Use discounts field. This field will be removed in Saleor 4.0."
+ )
"""
Translated discount name.
"""
- translatedDiscountName: String @deprecated(reason: "Use discounts field. This field will be removed in Saleor 4.0.")
+ translatedDiscountName: String
+ @deprecated(
+ reason: "Use discounts field. This field will be removed in Saleor 4.0."
+ )
"""
List of all discounts assigned to the order.
@@ -9578,7 +9889,10 @@ type OrderAddNote {
Order note created.
"""
event: OrderEvent
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -9597,7 +9911,10 @@ type OrderBulkCancel {
Returns how many objects were affected.
"""
count: Int!
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -9609,7 +9926,10 @@ type OrderCancel {
Canceled order.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -9621,7 +9941,10 @@ type OrderCapture {
Captured order.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -9630,7 +9953,10 @@ Confirms an unconfirmed order by changing status to unfulfilled.
"""
type OrderConfirm {
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -9712,7 +10038,10 @@ type OrderDiscountAdd {
Order which has been discounted.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -9741,7 +10070,10 @@ type OrderDiscountDelete {
Order which has removed discount.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -9768,7 +10100,10 @@ type OrderDiscountUpdate {
Order which has been discounted.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -10134,7 +10469,10 @@ type OrderFulfill {
Fulfilled order.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -10278,7 +10616,10 @@ type OrderLineDelete {
An order line that was deleted.
"""
orderLine: OrderLine
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -10295,7 +10636,10 @@ type OrderLineDiscountRemove {
Order which is related to line which has removed discount.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -10312,7 +10656,10 @@ type OrderLineDiscountUpdate {
Order which is related to the discounted line.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -10331,7 +10678,10 @@ type OrderLineUpdate {
Related order.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
orderLine: OrderLine
}
@@ -10349,7 +10699,10 @@ type OrderLinesCreate {
List of added order lines.
"""
orderLines: [OrderLine!]
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -10361,7 +10714,10 @@ type OrderMarkAsPaid {
Order marked as paid.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -10382,7 +10738,10 @@ type OrderRefund {
A refunded order.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -10533,7 +10892,9 @@ type OrderSettingsUpdate {
"""
orderSettings: OrderSettings
orderSettingsErrors: [OrderSettingsError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderSettingsError!]!
}
@@ -10642,7 +11003,10 @@ enum OrderStatusFilter {
Updates an order.
"""
type OrderUpdate {
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
order: Order
}
@@ -10672,7 +11036,10 @@ type OrderUpdateShipping {
Order with updated shipping method.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -10691,7 +11058,10 @@ type OrderVoid {
A voided order.
"""
order: Order
- orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ orderErrors: [OrderError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [OrderError!]!
}
@@ -10726,7 +11096,10 @@ type Page implements Node & ObjectWithMetadata {
"""
Content of the page (JSON).
"""
- contentJson: JSONString! @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.")
+ contentJson: JSONString!
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `content` field instead."
+ )
"""
Returns translated page fields for the given language code.
@@ -10752,7 +11125,10 @@ type PageAttributeAssign {
The updated page type.
"""
pageType: PageType
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
}
@@ -10764,7 +11140,10 @@ type PageAttributeUnassign {
The updated page type.
"""
pageType: PageType
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
}
@@ -10776,7 +11155,10 @@ type PageBulkDelete {
Returns how many objects were affected.
"""
count: Int!
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
}
@@ -10788,7 +11170,10 @@ type PageBulkPublish {
Returns how many objects were affected.
"""
count: Int!
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
}
@@ -10821,7 +11206,10 @@ type PageCountableEdge {
Creates a new page.
"""
type PageCreate {
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
page: Page
}
@@ -10872,7 +11260,10 @@ input PageCreateInput {
Deletes a page.
"""
type PageDelete {
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
page: Page
}
@@ -10993,7 +11384,10 @@ type PageReorderAttributeValues {
Page from which attribute values are reordered.
"""
page: Page
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
}
@@ -11049,7 +11443,10 @@ type PageTranslatableContent implements Node {
"""
Content of the page (JSON).
"""
- contentJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.")
+ contentJson: JSONString
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `content` field instead."
+ )
"""
Returns translated page fields for the given language code.
@@ -11072,7 +11469,9 @@ Creates/Updates translations for Page.
"""
type PageTranslate {
translationErrors: [TranslationError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [TranslationError!]!
page: PageTranslatableContent
}
@@ -11095,7 +11494,10 @@ type PageTranslation implements Node {
"""
Translated description of the page (JSON).
"""
- contentJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.")
+ contentJson: JSONString
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `content` field instead."
+ )
}
input PageTranslationInput {
@@ -11172,7 +11574,10 @@ type PageTypeBulkDelete {
Returns how many objects were affected.
"""
count: Int!
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
}
@@ -11205,7 +11610,10 @@ type PageTypeCountableEdge {
Create a new page type.
"""
type PageTypeCreate {
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
pageType: PageType
}
@@ -11231,7 +11639,10 @@ input PageTypeCreateInput {
Delete a page type.
"""
type PageTypeDelete {
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
pageType: PageType
}
@@ -11248,7 +11659,10 @@ type PageTypeReorderAttributes {
Page type from which attributes are reordered.
"""
pageType: PageType
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
}
@@ -11280,7 +11694,10 @@ input PageTypeSortingInput {
Update page type.
"""
type PageTypeUpdate {
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
pageType: PageType
}
@@ -11311,7 +11728,10 @@ input PageTypeUpdateInput {
Updates an existing page.
"""
type PageUpdate {
- pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ pageErrors: [PageError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PageError!]!
page: Page
}
@@ -11325,7 +11745,9 @@ type PasswordChange {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -11397,7 +11819,9 @@ type PaymentCapture {
"""
payment: Payment
paymentErrors: [PaymentError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PaymentError!]!
}
@@ -11511,7 +11935,9 @@ Initializes payment process when it is required by gateway.
type PaymentInitialize {
initializedPayment: PaymentInitialized
paymentErrors: [PaymentError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PaymentError!]!
}
@@ -11566,7 +11992,9 @@ type PaymentRefund {
"""
payment: Payment
paymentErrors: [PaymentError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PaymentError!]!
}
@@ -11594,7 +12022,9 @@ type PaymentVoid {
"""
payment: Payment
paymentErrors: [PaymentError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PaymentError!]!
}
@@ -11641,7 +12071,9 @@ Create new permission group.
"""
type PermissionGroupCreate {
permissionGroupErrors: [PermissionGroupError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PermissionGroupError!]!
group: Group
}
@@ -11668,7 +12100,9 @@ Delete permission group.
"""
type PermissionGroupDelete {
permissionGroupErrors: [PermissionGroupError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PermissionGroupError!]!
group: Group
}
@@ -11742,7 +12176,9 @@ Update permission group.
"""
type PermissionGroupUpdate {
permissionGroupErrors: [PermissionGroupError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PermissionGroupError!]!
group: Group
}
@@ -11917,7 +12353,9 @@ Update plugin configuration.
type PluginUpdate {
plugin: Plugin
pluginsErrors: [PluginError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [PluginError!]!
}
@@ -11994,7 +12432,10 @@ type Product implements Node & ObjectWithMetadata {
"""
Description of the product (JSON).
"""
- descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
+ descriptionJson: JSONString
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `description` field instead."
+ )
"""
The main thumbnail for a product.
@@ -12059,7 +12500,10 @@ type Product implements Node & ObjectWithMetadata {
ID of a product image.
"""
id: ID
- ): ProductImage @deprecated(reason: "Will be removed in Saleor 4.0. Use the `mediaById` field instead.")
+ ): ProductImage
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `mediaById` field instead."
+ )
"""
List of variants for the product.
@@ -12074,7 +12518,10 @@ type Product implements Node & ObjectWithMetadata {
"""
List of images for the product.
"""
- images: [ProductImage] @deprecated(reason: "Will be removed in Saleor 4.0. Use the `media` field instead.")
+ images: [ProductImage]
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `media` field instead."
+ )
"""
List of collections for the product.
@@ -12111,7 +12558,9 @@ type ProductAttributeAssign {
"""
productType: ProductType
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -12141,7 +12590,9 @@ type ProductAttributeUnassign {
"""
productType: ProductType
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -12154,7 +12605,9 @@ type ProductBulkDelete {
"""
count: Int!
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -12291,7 +12744,9 @@ type ProductChannelListingUpdate {
"""
product: Product
productChannelListingErrors: [ProductChannelListingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductChannelListingError!]!
}
@@ -12337,7 +12792,9 @@ Creates a new product.
"""
type ProductCreate {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
product: Product
}
@@ -12409,7 +12866,9 @@ Deletes a product.
"""
type ProductDelete {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
product: Product
}
@@ -12619,7 +13078,9 @@ type ProductMediaBulkDelete {
"""
count: Int!
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -12630,7 +13091,9 @@ type ProductMediaCreate {
product: Product
media: ProductMedia
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -12663,7 +13126,9 @@ type ProductMediaDelete {
product: Product
media: ProductMedia
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -12674,7 +13139,9 @@ type ProductMediaReorder {
product: Product
media: [ProductMedia!]
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -12700,7 +13167,9 @@ type ProductMediaUpdate {
product: Product
media: ProductMedia
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -12830,7 +13299,9 @@ type ProductReorderAttributeValues {
"""
product: Product
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -12852,7 +13323,10 @@ type ProductTranslatableContent implements Node {
"""
Description of the product (JSON).
"""
- descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
+ descriptionJson: JSONString
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `description` field instead."
+ )
"""
Returns translated product fields for the given language code.
@@ -12875,7 +13349,9 @@ Creates/Updates translations for Product.
"""
type ProductTranslate {
translationErrors: [TranslationError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [TranslationError!]!
product: Product
}
@@ -12898,7 +13374,10 @@ type ProductTranslation implements Node {
"""
Translated description of the product (JSON).
"""
- descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.")
+ descriptionJson: JSONString
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `description` field instead."
+ )
}
"""
@@ -13012,7 +13491,9 @@ type ProductTypeBulkDelete {
"""
count: Int!
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -13051,7 +13532,9 @@ Creates a new product type.
"""
type ProductTypeCreate {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
productType: ProductType
}
@@ -13061,7 +13544,9 @@ Deletes a product type.
"""
type ProductTypeDelete {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
productType: ProductType
}
@@ -13135,7 +13620,9 @@ type ProductTypeReorderAttributes {
"""
productType: ProductType
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -13173,7 +13660,9 @@ Updates an existing product type.
"""
type ProductTypeUpdate {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
productType: ProductType
}
@@ -13183,7 +13672,9 @@ Updates an existing product.
"""
type ProductUpdate {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
product: Product
}
@@ -13260,7 +13751,10 @@ type ProductVariant implements Node & ObjectWithMetadata {
"""
List of images for the product variant.
"""
- images: [ProductImage] @deprecated(reason: "Will be removed in Saleor 4.0. Use the `media` instead.")
+ images: [ProductImage]
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `media` instead."
+ )
"""
List of media for the product variant.
@@ -13327,7 +13821,9 @@ type ProductVariantBulkCreate {
"""
productVariants: [ProductVariant!]!
bulkProductErrors: [BulkProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [BulkProductError!]!
}
@@ -13372,7 +13868,9 @@ type ProductVariantBulkDelete {
"""
count: Int!
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -13424,7 +13922,9 @@ type ProductVariantChannelListingUpdate {
"""
variant: ProductVariant
productChannelListingErrors: [ProductChannelListingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductChannelListingError!]!
}
@@ -13458,7 +13958,9 @@ Creates a new variant for a product.
"""
type ProductVariantCreate {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
productVariant: ProductVariant
}
@@ -13500,7 +14002,9 @@ Deletes a product variant.
"""
type ProductVariantDelete {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
productVariant: ProductVariant
}
@@ -13539,7 +14043,9 @@ Reorder the variants of a product. Mutation updates updated_at on product and tr
type ProductVariantReorder {
product: Product
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -13552,7 +14058,9 @@ type ProductVariantReorderAttributeValues {
"""
productVariant: ProductVariant
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -13562,7 +14070,9 @@ Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook.
type ProductVariantSetDefault {
product: Product
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -13575,7 +14085,9 @@ type ProductVariantStocksCreate {
"""
productVariant: ProductVariant
bulkStockErrors: [BulkStockError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [BulkStockError!]!
}
@@ -13587,7 +14099,10 @@ type ProductVariantStocksDelete {
Updated product variant.
"""
productVariant: ProductVariant
- stockErrors: [StockError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ stockErrors: [StockError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [StockError!]!
}
@@ -13600,7 +14115,9 @@ type ProductVariantStocksUpdate {
"""
productVariant: ProductVariant
bulkStockErrors: [BulkStockError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [BulkStockError!]!
}
@@ -13632,7 +14149,9 @@ Creates/Updates translations for Product Variant.
"""
type ProductVariantTranslate {
translationErrors: [TranslationError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [TranslationError!]!
productVariant: ProductVariant
}
@@ -13655,7 +14174,9 @@ Updates an existing variant for product.
"""
type ProductVariantUpdate {
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
productVariant: ProductVariant
}
@@ -15261,7 +15782,9 @@ type RefreshToken {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -15291,7 +15814,9 @@ type RequestEmailChange {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -15300,7 +15825,9 @@ Sends an email with the account password modification link.
"""
type RequestPasswordReset {
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -15427,7 +15954,9 @@ type SaleAddCatalogues {
"""
sale: Sale
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
}
@@ -15440,7 +15969,9 @@ type SaleBulkDelete {
"""
count: Int!
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
}
@@ -15490,7 +16021,9 @@ type SaleChannelListingUpdate {
"""
sale: Sale
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
}
@@ -15524,7 +16057,9 @@ Creates a new sale.
"""
type SaleCreate {
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
sale: Sale
}
@@ -15534,7 +16069,9 @@ Deletes a sale.
"""
type SaleDelete {
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
sale: Sale
}
@@ -15597,7 +16134,9 @@ type SaleRemoveCatalogues {
"""
sale: Sale
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
}
@@ -15673,7 +16212,9 @@ Creates/updates translations for a sale.
"""
type SaleTranslate {
translationErrors: [TranslationError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [TranslationError!]!
sale: Sale
}
@@ -15711,7 +16252,9 @@ Updates a sale.
"""
type SaleUpdate {
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
sale: Sale
}
@@ -15767,7 +16310,9 @@ type SetPassword {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -15960,7 +16505,9 @@ type ShippingMethodChannelListingUpdate {
"""
shippingMethod: ShippingMethod
shippingErrors: [ShippingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShippingError!]!
}
@@ -16056,7 +16603,9 @@ type ShippingPriceBulkDelete {
"""
count: Int!
shippingErrors: [ShippingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShippingError!]!
}
@@ -16070,7 +16619,9 @@ type ShippingPriceCreate {
shippingZone: ShippingZone
shippingMethod: ShippingMethod
shippingErrors: [ShippingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShippingError!]!
}
@@ -16088,7 +16639,9 @@ type ShippingPriceDelete {
"""
shippingZone: ShippingZone
shippingErrors: [ShippingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShippingError!]!
}
@@ -16101,7 +16654,9 @@ type ShippingPriceExcludeProducts {
"""
shippingMethod: ShippingMethod
shippingErrors: [ShippingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShippingError!]!
}
@@ -16178,7 +16733,9 @@ type ShippingPriceRemoveProductFromExclude {
"""
shippingMethod: ShippingMethod
shippingErrors: [ShippingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShippingError!]!
}
@@ -16187,7 +16744,9 @@ Creates/Updates translations for shipping method.
"""
type ShippingPriceTranslate {
translationErrors: [TranslationError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [TranslationError!]!
shippingMethod: ShippingMethod
}
@@ -16211,7 +16770,9 @@ type ShippingPriceUpdate {
shippingZone: ShippingZone
shippingMethod: ShippingMethod
shippingErrors: [ShippingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShippingError!]!
}
@@ -16276,7 +16837,9 @@ type ShippingZoneBulkDelete {
"""
count: Int!
shippingErrors: [ShippingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShippingError!]!
}
@@ -16310,7 +16873,9 @@ Creates a new shipping zone.
"""
type ShippingZoneCreate {
shippingErrors: [ShippingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShippingError!]!
shippingZone: ShippingZone
}
@@ -16352,7 +16917,9 @@ Deletes a shipping zone.
"""
type ShippingZoneDelete {
shippingErrors: [ShippingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShippingError!]!
shippingZone: ShippingZone
}
@@ -16367,7 +16934,9 @@ Updates a new shipping zone.
"""
type ShippingZoneUpdate {
shippingErrors: [ShippingError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShippingError!]!
shippingZone: ShippingZone
}
@@ -16597,7 +17166,10 @@ type ShopAddressUpdate {
Updated shop.
"""
shop: Shop
- shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ shopErrors: [ShopError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShopError!]!
}
@@ -16609,7 +17181,10 @@ type ShopDomainUpdate {
Updated shop.
"""
shop: Shop
- shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ shopErrors: [ShopError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShopError!]!
}
@@ -16651,7 +17226,10 @@ type ShopFetchTaxRates {
Updated shop.
"""
shop: Shop
- shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ shopErrors: [ShopError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShopError!]!
}
@@ -16731,7 +17309,9 @@ type ShopSettingsTranslate {
"""
shop: Shop
translationErrors: [TranslationError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [TranslationError!]!
}
@@ -16748,7 +17328,10 @@ type ShopSettingsUpdate {
Updated shop.
"""
shop: Shop
- shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ shopErrors: [ShopError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShopError!]!
}
@@ -16786,7 +17369,10 @@ type StaffBulkDelete {
Returns how many objects were affected.
"""
count: Int!
- staffErrors: [StaffError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ staffErrors: [StaffError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [StaffError!]!
}
@@ -16794,7 +17380,10 @@ type StaffBulkDelete {
Creates a new staff user.
"""
type StaffCreate {
- staffErrors: [StaffError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ staffErrors: [StaffError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [StaffError!]!
user: User
}
@@ -16840,7 +17429,10 @@ input StaffCreateInput {
Deletes a staff user.
"""
type StaffDelete {
- staffErrors: [StaffError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ staffErrors: [StaffError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [StaffError!]!
user: User
}
@@ -16923,7 +17515,10 @@ type StaffNotificationRecipient implements Node {
Creates a new staff notification recipient.
"""
type StaffNotificationRecipientCreate {
- shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ shopErrors: [ShopError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShopError!]!
staffNotificationRecipient: StaffNotificationRecipient
}
@@ -16932,7 +17527,10 @@ type StaffNotificationRecipientCreate {
Delete staff notification recipient.
"""
type StaffNotificationRecipientDelete {
- shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ shopErrors: [ShopError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShopError!]!
staffNotificationRecipient: StaffNotificationRecipient
}
@@ -16958,7 +17556,10 @@ input StaffNotificationRecipientInput {
Updates a staff notification recipient.
"""
type StaffNotificationRecipientUpdate {
- shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ shopErrors: [ShopError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ShopError!]!
staffNotificationRecipient: StaffNotificationRecipient
}
@@ -16967,7 +17568,10 @@ type StaffNotificationRecipientUpdate {
Updates an existing staff user.
"""
type StaffUpdate {
- staffErrors: [StaffError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ staffErrors: [StaffError!]!
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [StaffError!]!
user: User
}
@@ -17380,7 +17984,9 @@ Updates metadata of an object.
"""
type UpdateMetadata {
metadataErrors: [MetadataError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MetadataError!]!
item: ObjectWithMetadata
}
@@ -17390,7 +17996,9 @@ Updates private metadata of an object.
"""
type UpdatePrivateMetadata {
metadataErrors: [MetadataError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [MetadataError!]!
item: ObjectWithMetadata
}
@@ -17466,7 +18074,9 @@ type User implements Node & ObjectWithMetadata {
Returns the last open checkout of this user.
"""
checkout: Checkout
- @deprecated(reason: "Will be removed in Saleor 4.0. Use the `checkout_tokens` field to fetch the user checkouts.")
+ @deprecated(
+ reason: "Will be removed in Saleor 4.0. Use the `checkout_tokens` field to fetch the user checkouts."
+ )
"""
Returns the checkout UUID's assigned to this user.
@@ -17579,7 +18189,9 @@ type UserAvatarDelete {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -17592,7 +18204,9 @@ type UserAvatarUpdate {
"""
user: User
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -17605,7 +18219,9 @@ type UserBulkSetActive {
"""
count: Int!
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -17775,7 +18391,9 @@ type VariantMediaAssign {
productVariant: ProductVariant
media: ProductMedia
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -17786,7 +18404,9 @@ type VariantMediaUnassign {
productVariant: ProductVariant
media: ProductMedia
productErrors: [ProductError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [ProductError!]!
}
@@ -17844,7 +18464,9 @@ type VerifyToken {
"""
payload: GenericScalar
accountErrors: [AccountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [AccountError!]!
}
@@ -18015,7 +18637,9 @@ type VoucherAddCatalogues {
"""
voucher: Voucher
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
}
@@ -18028,7 +18652,9 @@ type VoucherBulkDelete {
"""
count: Int!
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
}
@@ -18084,7 +18710,9 @@ type VoucherChannelListingUpdate {
"""
voucher: Voucher
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
}
@@ -18118,7 +18746,9 @@ Creates a new voucher.
"""
type VoucherCreate {
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
voucher: Voucher
}
@@ -18128,7 +18758,9 @@ Deletes a voucher.
"""
type VoucherDelete {
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
voucher: Voucher
}
@@ -18228,7 +18860,9 @@ type VoucherRemoveCatalogues {
"""
voucher: Voucher
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
}
@@ -18314,7 +18948,9 @@ Creates/Updates translations for Voucher.
"""
type VoucherTranslate {
translationErrors: [TranslationError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [TranslationError!]!
voucher: Voucher
}
@@ -18343,7 +18979,9 @@ Updates a voucher.
"""
type VoucherUpdate {
discountErrors: [DiscountError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [DiscountError!]!
voucher: Voucher
}
@@ -18359,7 +18997,12 @@ type Warehouse implements Node & ObjectWithMetadata {
name: String!
slug: String!
companyName: String!
- shippingZones(before: String, after: String, first: Int, last: Int): ShippingZoneCountableConnection!
+ shippingZones(
+ before: String
+ after: String
+ first: Int
+ last: Int
+ ): ShippingZoneCountableConnection!
address: Address!
email: String!
@@ -18446,7 +19089,9 @@ Creates new warehouse.
"""
type WarehouseCreate {
warehouseErrors: [WarehouseError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [WarehouseError!]!
warehouse: Warehouse
}
@@ -18488,7 +19133,9 @@ Deletes selected warehouse.
"""
type WarehouseDelete {
warehouseErrors: [WarehouseError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [WarehouseError!]!
warehouse: Warehouse
}
@@ -18532,7 +19179,9 @@ Add shipping zone to given warehouse.
"""
type WarehouseShippingZoneAssign {
warehouseErrors: [WarehouseError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [WarehouseError!]!
warehouse: Warehouse
}
@@ -18542,7 +19191,9 @@ Remove shipping zone from given warehouse.
"""
type WarehouseShippingZoneUnassign {
warehouseErrors: [WarehouseError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [WarehouseError!]!
warehouse: Warehouse
}
@@ -18571,7 +19222,9 @@ Updates given warehouse.
"""
type WarehouseUpdate {
warehouseErrors: [WarehouseError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [WarehouseError!]!
warehouse: Warehouse
}
@@ -18629,7 +19282,9 @@ Creates a new webhook subscription.
"""
type WebhookCreate {
webhookErrors: [WebhookError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [WebhookError!]!
webhook: Webhook
}
@@ -18671,7 +19326,9 @@ Deletes a webhook subscription.
"""
type WebhookDelete {
webhookErrors: [WebhookError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [WebhookError!]!
webhook: Webhook
}
@@ -18884,7 +19541,9 @@ Updates a webhook subscription.
"""
type WebhookUpdate {
webhookErrors: [WebhookError!]!
- @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.")
+ @deprecated(
+ reason: "Use errors field instead. This field will be removed in Saleor 4.0."
+ )
errors: [WebhookError!]!
webhook: Webhook
}
diff --git a/packages/saleor/src/api/endpoints/checkout/index.ts b/packages/saleor/src/api/endpoints/checkout/index.ts
index 2468c8d97..5c5c6d398 100644
--- a/packages/saleor/src/api/endpoints/checkout/index.ts
+++ b/packages/saleor/src/api/endpoints/checkout/index.ts
@@ -6,7 +6,11 @@ export type CheckoutAPI = GetAPISchema
export type CheckoutEndpoint = CheckoutAPI['endpoint']
-const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ req, res, config }) => {
+const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({
+ req,
+ res,
+ config,
+}) => {
try {
const html = `
diff --git a/packages/saleor/src/api/index.ts b/packages/saleor/src/api/index.ts
index 7ee17f693..4cfeabe1a 100644
--- a/packages/saleor/src/api/index.ts
+++ b/packages/saleor/src/api/index.ts
@@ -1,13 +1,21 @@
-import { CommerceAPI, CommerceAPIConfig, getCommerceApi as commerceApi } from '@vercel/commerce/api'
+import {
+ CommerceAPI,
+ CommerceAPIConfig,
+ getCommerceApi as commerceApi,
+} from '@vercel/commerce/api'
import * as operations from './operations'
import * as Const from '../const'
if (!Const.API_URL) {
- throw new Error(`The environment variable NEXT_SALEOR_API_URL is missing and it's required to access your store`)
+ throw new Error(
+ `The environment variable NEXT_SALEOR_API_URL is missing and it's required to access your store`
+ )
}
if (!Const.API_CHANNEL) {
- throw new Error(`The environment variable NEXT_SALEOR_CHANNEL is missing and it's required to access your store`)
+ throw new Error(
+ `The environment variable NEXT_SALEOR_CHANNEL is missing and it's required to access your store`
+ )
}
import fetchGraphqlApi from './utils/fetch-graphql-api'
@@ -33,6 +41,8 @@ export type Provider = typeof provider
export type SaleorAPI
= CommerceAPI
-export function getCommerceApi
(customProvider: P = provider as any): SaleorAPI
{
+export function getCommerceApi
(
+ customProvider: P = provider as any
+): SaleorAPI
{
return commerceApi(customProvider)
}
diff --git a/packages/saleor/src/api/operations/get-all-pages.ts b/packages/saleor/src/api/operations/get-all-pages.ts
index 37f2e3ab2..9fe615d9d 100644
--- a/packages/saleor/src/api/operations/get-all-pages.ts
+++ b/packages/saleor/src/api/operations/get-all-pages.ts
@@ -6,9 +6,12 @@ import * as Query from '../../utils/queries'
export type Page = any
-export type GetAllPagesResult = T
+export type GetAllPagesResult =
+ T
-export default function getAllPagesOperation({ commerce }: OperationContext) {
+export default function getAllPagesOperation({
+ commerce,
+}: OperationContext) {
async function getAllPages({
query = Query.PageMany,
config,
@@ -34,11 +37,13 @@ export default function getAllPagesOperation({ commerce }: OperationContext ({
- ...node,
- url: `/${locale}/${slug}`,
- name,
- }))
+ const pages = data.pages?.edges?.map(
+ ({ node: { title: name, slug, ...node } }: PageCountableEdge) => ({
+ ...node,
+ url: `/${locale}/${slug}`,
+ name,
+ })
+ )
return { pages }
}
diff --git a/packages/saleor/src/api/operations/get-all-product-paths.ts b/packages/saleor/src/api/operations/get-all-product-paths.ts
index 66e8f95c9..97fe78245 100644
--- a/packages/saleor/src/api/operations/get-all-product-paths.ts
+++ b/packages/saleor/src/api/operations/get-all-product-paths.ts
@@ -9,7 +9,9 @@ export type GetAllProductPathsResult = {
products: Array<{ path: string }>
}
-export default function getAllProductPathsOperation({ commerce }: OperationContext) {
+export default function getAllProductPathsOperation({
+ commerce,
+}: OperationContext) {
async function getAllProductPaths({
query,
config,
diff --git a/packages/saleor/src/api/operations/get-all-products.ts b/packages/saleor/src/api/operations/get-all-products.ts
index f7982adee..4c734a180 100644
--- a/packages/saleor/src/api/operations/get-all-products.ts
+++ b/packages/saleor/src/api/operations/get-all-products.ts
@@ -12,7 +12,9 @@ type ReturnType = {
products: Product[]
}
-export default function getAllProductsOperation({ commerce }: OperationContext) {
+export default function getAllProductsOperation({
+ commerce,
+}: OperationContext) {
async function getAllProducts({
query = Query.ProductMany,
variables,
@@ -46,13 +48,18 @@ export default function getAllProductsOperation({ commerce }: OperationContext
normalizeProduct(p)) ?? []
+ data.collection.products?.edges?.map(
+ ({ node: p }: ProductCountableEdge) => normalizeProduct(p)
+ ) ?? []
return {
products,
}
} else {
- const products = data.products?.edges?.map(({ node: p }: ProductCountableEdge) => normalizeProduct(p)) ?? []
+ const products =
+ data.products?.edges?.map(({ node: p }: ProductCountableEdge) =>
+ normalizeProduct(p)
+ ) ?? []
return {
products,
diff --git a/packages/saleor/src/api/operations/get-page.ts b/packages/saleor/src/api/operations/get-page.ts
index bab9d92c5..40e49d630 100644
--- a/packages/saleor/src/api/operations/get-page.ts
+++ b/packages/saleor/src/api/operations/get-page.ts
@@ -8,7 +8,9 @@ export type Page = any
export type GetPageResult = T
-export default function getPageOperation({ commerce }: OperationContext) {
+export default function getPageOperation({
+ commerce,
+}: OperationContext) {
async function getPage({
query = Query.PageOne,
variables,
diff --git a/packages/saleor/src/api/operations/get-product.ts b/packages/saleor/src/api/operations/get-product.ts
index 5a33dec7b..410319adc 100644
--- a/packages/saleor/src/api/operations/get-product.ts
+++ b/packages/saleor/src/api/operations/get-product.ts
@@ -12,7 +12,9 @@ type ReturnType = {
product: any
}
-export default function getProductOperation({ commerce }: OperationContext) {
+export default function getProductOperation({
+ commerce,
+}: OperationContext) {
async function getProduct({
query = Query.ProductOneBySlug,
variables,
diff --git a/packages/saleor/src/api/operations/get-site-info.ts b/packages/saleor/src/api/operations/get-site-info.ts
index 6ce7408e4..58c4a7380 100644
--- a/packages/saleor/src/api/operations/get-site-info.ts
+++ b/packages/saleor/src/api/operations/get-site-info.ts
@@ -9,7 +9,9 @@ interface GetSiteInfoResult {
brands: any[]
}
-export default function getSiteInfoOperation({ commerce }: OperationContext) {
+export default function getSiteInfoOperation({
+ commerce,
+}: OperationContext) {
async function getSiteInfo({
query,
config,
diff --git a/packages/saleor/src/api/operations/login.ts b/packages/saleor/src/api/operations/login.ts
index 76d1e7844..30fc64149 100644
--- a/packages/saleor/src/api/operations/login.ts
+++ b/packages/saleor/src/api/operations/login.ts
@@ -5,7 +5,9 @@ import { throwUserErrors } from '../../utils'
import * as Mutation from '../../utils/mutations'
-export default function loginOperation({ commerce }: OperationContext) {
+export default function loginOperation({
+ commerce,
+}: OperationContext) {
async function login({
query = Mutation.SessionCreate,
variables,
diff --git a/packages/saleor/src/api/utils/fetch-graphql-api.ts b/packages/saleor/src/api/utils/fetch-graphql-api.ts
index de4d45aae..cbb22e0e3 100644
--- a/packages/saleor/src/api/utils/fetch-graphql-api.ts
+++ b/packages/saleor/src/api/utils/fetch-graphql-api.ts
@@ -6,7 +6,11 @@ import { getError } from '../../utils/handle-fetch-response'
import { getCommerceApi } from '..'
import { getToken } from '../../utils/index'
-const fetchGraphqlApi: GraphQLFetcher = async (query: string, { variables } = {}, fetchOptions) => {
+const fetchGraphqlApi: GraphQLFetcher = async (
+ query: string,
+ { variables } = {},
+ fetchOptions
+) => {
const config = getCommerceApi().getConfig()
const token = getToken()
diff --git a/packages/saleor/src/api/utils/is-allowed-method.ts b/packages/saleor/src/api/utils/is-allowed-method.ts
index cbaab2251..78bbba568 100644
--- a/packages/saleor/src/api/utils/is-allowed-method.ts
+++ b/packages/saleor/src/api/utils/is-allowed-method.ts
@@ -1,7 +1,13 @@
import type { NextApiRequest, NextApiResponse } from 'next'
-export default function isAllowedMethod(req: NextApiRequest, res: NextApiResponse, allowedMethods: string[]) {
- const methods = allowedMethods.includes('OPTIONS') ? allowedMethods : [...allowedMethods, 'OPTIONS']
+export default function isAllowedMethod(
+ req: NextApiRequest,
+ res: NextApiResponse,
+ allowedMethods: string[]
+) {
+ const methods = allowedMethods.includes('OPTIONS')
+ ? allowedMethods
+ : [...allowedMethods, 'OPTIONS']
if (!req.method || !methods.includes(req.method)) {
res.status(405)
diff --git a/packages/saleor/src/auth/use-login.tsx b/packages/saleor/src/auth/use-login.tsx
index 33f95da2b..c9576b474 100644
--- a/packages/saleor/src/auth/use-login.tsx
+++ b/packages/saleor/src/auth/use-login.tsx
@@ -6,7 +6,13 @@ import useCustomer from '../customer/use-customer'
import * as mutation from '../utils/mutations'
import { Mutation, MutationTokenCreateArgs } from '../../schema'
import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login'
-import { setCSRFToken, setToken, throwUserErrors, checkoutAttach, getCheckoutId } from '../utils'
+import {
+ setCSRFToken,
+ setToken,
+ throwUserErrors,
+ checkoutAttach,
+ getCheckoutId,
+} from '../utils'
import { LoginHook } from '@vercel/commerce/types/login'
export default useLogin as UseLogin
@@ -18,7 +24,8 @@ export const handler: MutationHook = {
async fetcher({ input: { email, password }, options, fetch }) {
if (!(email && password)) {
throw new CommerceError({
- message: 'A first name, last name, email and password are required to login',
+ message:
+ 'A first name, last name, email and password are required to login',
})
}
diff --git a/packages/saleor/src/auth/use-logout.tsx b/packages/saleor/src/auth/use-logout.tsx
index 396cb472a..1d436d893 100644
--- a/packages/saleor/src/auth/use-logout.tsx
+++ b/packages/saleor/src/auth/use-logout.tsx
@@ -3,7 +3,11 @@ import type { MutationHook } from '@vercel/commerce/utils/types'
import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout'
import useCustomer from '../customer/use-customer'
import * as mutation from '../utils/mutations'
-import { setCSRFToken, setToken, setCheckoutToken } from '../utils/customer-token'
+import {
+ setCSRFToken,
+ setToken,
+ setCheckoutToken,
+} from '../utils/customer-token'
import { LogoutHook } from '@vercel/commerce/types/logout'
export default useLogout as UseLogout
diff --git a/packages/saleor/src/auth/use-signup.tsx b/packages/saleor/src/auth/use-signup.tsx
index e29ee3b1a..ef5dd617d 100644
--- a/packages/saleor/src/auth/use-signup.tsx
+++ b/packages/saleor/src/auth/use-signup.tsx
@@ -3,7 +3,11 @@ import type { MutationHook } from '@vercel/commerce/utils/types'
import { CommerceError } from '@vercel/commerce/utils/errors'
import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup'
import useCustomer from '../customer/use-customer'
-import { AccountRegisterInput, Mutation, MutationAccountRegisterArgs } from '../../schema'
+import {
+ AccountRegisterInput,
+ Mutation,
+ MutationAccountRegisterArgs,
+} from '../../schema'
import * as mutation from '../utils/mutations'
import { handleAutomaticLogin, throwUserErrors } from '../utils'
@@ -18,11 +22,15 @@ export const handler: MutationHook = {
async fetcher({ input: { email, password }, options, fetch }) {
if (!(email && password)) {
throw new CommerceError({
- message: 'A first name, last name, email and password are required to signup',
+ message:
+ 'A first name, last name, email and password are required to signup',
})
}
- const { customerCreate } = await fetch({
+ const { customerCreate } = await fetch<
+ Mutation,
+ MutationAccountRegisterArgs
+ >({
...options,
variables: {
input: {
diff --git a/packages/saleor/src/cart/use-add-item.tsx b/packages/saleor/src/cart/use-add-item.tsx
index 2db070233..e76cc6de7 100644
--- a/packages/saleor/src/cart/use-add-item.tsx
+++ b/packages/saleor/src/cart/use-add-item.tsx
@@ -16,13 +16,19 @@ export default useAddItem as UseAddItem
export const handler: MutationHook = {
fetchOptions: { query: mutation.CheckoutLineAdd },
async fetcher({ input: item, options, fetch }) {
- if (item.quantity && (!Number.isInteger(item.quantity) || item.quantity! < 1)) {
+ if (
+ item.quantity &&
+ (!Number.isInteger(item.quantity) || item.quantity! < 1)
+ ) {
throw new CommerceError({
message: 'The item quantity has to be a valid integer greater than 0',
})
}
- const { checkoutLinesAdd } = await fetch({
+ const { checkoutLinesAdd } = await fetch<
+ Mutation,
+ MutationCheckoutLinesAddArgs
+ >({
...options,
variables: {
checkoutId: getCheckoutId().checkoutId,
diff --git a/packages/saleor/src/cart/use-remove-item.tsx b/packages/saleor/src/cart/use-remove-item.tsx
index 09d1acab7..1b2ccfa3a 100644
--- a/packages/saleor/src/cart/use-remove-item.tsx
+++ b/packages/saleor/src/cart/use-remove-item.tsx
@@ -1,6 +1,12 @@
import { useCallback } from 'react'
-import type { MutationHookContext, HookFetcherContext, MutationHook } from '@vercel/commerce/utils/types'
-import useRemoveItem, { UseRemoveItem } from '@vercel/commerce/cart/use-remove-item'
+import type {
+ MutationHookContext,
+ HookFetcherContext,
+ MutationHook,
+} from '@vercel/commerce/utils/types'
+import useRemoveItem, {
+ UseRemoveItem,
+} from '@vercel/commerce/cart/use-remove-item'
import useCart from './use-cart'
import * as mutation from '../utils/mutations'
import { getCheckoutId, checkoutToCart } from '../utils'
@@ -11,7 +17,11 @@ export default useRemoveItem as UseRemoveItem
export const handler = {
fetchOptions: { query: mutation.CheckoutLineDelete },
- async fetcher({ input: { itemId }, options, fetch }: HookFetcherContext) {
+ async fetcher({
+ input: { itemId },
+ options,
+ fetch,
+ }: HookFetcherContext) {
const data = await fetch({
...options,
variables: {
diff --git a/packages/saleor/src/cart/use-update-item.tsx b/packages/saleor/src/cart/use-update-item.tsx
index ffca9b2f8..29f05516b 100644
--- a/packages/saleor/src/cart/use-update-item.tsx
+++ b/packages/saleor/src/cart/use-update-item.tsx
@@ -1,8 +1,13 @@
import { useCallback } from 'react'
import debounce from 'lodash.debounce'
-import type { HookFetcherContext, MutationHookContext } from '@vercel/commerce/utils/types'
+import type {
+ HookFetcherContext,
+ MutationHookContext,
+} from '@vercel/commerce/utils/types'
import { ValidationError } from '@vercel/commerce/utils/errors'
-import useUpdateItem, { UseUpdateItem } from '@vercel/commerce/cart/use-update-item'
+import useUpdateItem, {
+ UseUpdateItem,
+} from '@vercel/commerce/cart/use-update-item'
import useCart from './use-cart'
import { handler as removeItemHandler } from './use-remove-item'
@@ -23,7 +28,11 @@ export default useUpdateItem as UseUpdateItem
export const handler = {
fetchOptions: { query: mutation.CheckoutLineUpdate },
- async fetcher({ input: { itemId, item }, options, fetch }: HookFetcherContext) {
+ async fetcher({
+ input: { itemId, item },
+ options,
+ fetch,
+ }: HookFetcherContext) {
if (Number.isInteger(item.quantity)) {
// Also allow the update hook to remove an item if the quantity is lower than 1
if (item.quantity! < 1) {
@@ -40,7 +49,10 @@ export const handler = {
}
const checkoutId = getCheckoutId().checkoutId
- const { checkoutLinesUpdate } = await fetch({
+ const { checkoutLinesUpdate } = await fetch<
+ Mutation,
+ MutationCheckoutLinesUpdateArgs
+ >({
...options,
variables: {
checkoutId,
diff --git a/packages/saleor/src/checkout/use-checkout.tsx b/packages/saleor/src/checkout/use-checkout.tsx
index cab52bb60..76997be73 100644
--- a/packages/saleor/src/checkout/use-checkout.tsx
+++ b/packages/saleor/src/checkout/use-checkout.tsx
@@ -1,5 +1,7 @@
import { SWRHook } from '@vercel/commerce/utils/types'
-import useCheckout, { UseCheckout } from '@vercel/commerce/checkout/use-checkout'
+import useCheckout, {
+ UseCheckout,
+} from '@vercel/commerce/checkout/use-checkout'
export default useCheckout as UseCheckout
diff --git a/packages/saleor/src/customer/address/use-add-item.tsx b/packages/saleor/src/customer/address/use-add-item.tsx
index fabd11b1d..4f85c8472 100644
--- a/packages/saleor/src/customer/address/use-add-item.tsx
+++ b/packages/saleor/src/customer/address/use-add-item.tsx
@@ -1,4 +1,6 @@
-import useAddItem, { UseAddItem } from '@vercel/commerce/customer/address/use-add-item'
+import useAddItem, {
+ UseAddItem,
+} from '@vercel/commerce/customer/address/use-add-item'
import { MutationHook } from '@vercel/commerce/utils/types'
export default useAddItem as UseAddItem
diff --git a/packages/saleor/src/customer/card/use-add-item.tsx b/packages/saleor/src/customer/card/use-add-item.tsx
index 938e6cd61..77d149eff 100644
--- a/packages/saleor/src/customer/card/use-add-item.tsx
+++ b/packages/saleor/src/customer/card/use-add-item.tsx
@@ -1,4 +1,6 @@
-import useAddItem, { UseAddItem } from '@vercel/commerce/customer/card/use-add-item'
+import useAddItem, {
+ UseAddItem,
+} from '@vercel/commerce/customer/card/use-add-item'
import { MutationHook } from '@vercel/commerce/utils/types'
export default useAddItem as UseAddItem
diff --git a/packages/saleor/src/customer/use-customer.tsx b/packages/saleor/src/customer/use-customer.tsx
index 841793886..1d20b258d 100644
--- a/packages/saleor/src/customer/use-customer.tsx
+++ b/packages/saleor/src/customer/use-customer.tsx
@@ -1,4 +1,6 @@
-import useCustomer, { UseCustomer } from '@vercel/commerce/customer/use-customer'
+import useCustomer, {
+ UseCustomer,
+} from '@vercel/commerce/customer/use-customer'
import { CustomerHook } from '@vercel/commerce/types/customer'
import { SWRHook } from '@vercel/commerce/utils/types'
diff --git a/packages/saleor/src/fetcher.ts b/packages/saleor/src/fetcher.ts
index c1be921c5..4e7c5f194 100644
--- a/packages/saleor/src/fetcher.ts
+++ b/packages/saleor/src/fetcher.ts
@@ -2,7 +2,12 @@ import { Fetcher } from '@vercel/commerce/utils/types'
import { API_URL } from './const'
import { getToken, handleFetchResponse } from './utils'
-const fetcher: Fetcher = async ({ url = API_URL, method = 'POST', variables, query }) => {
+const fetcher: Fetcher = async ({
+ url = API_URL,
+ method = 'POST',
+ variables,
+ query,
+}) => {
const token = getToken()
return handleFetchResponse(
diff --git a/packages/saleor/src/index.tsx b/packages/saleor/src/index.tsx
index cf9aaf6e8..af7318b5e 100644
--- a/packages/saleor/src/index.tsx
+++ b/packages/saleor/src/index.tsx
@@ -1,4 +1,7 @@
-import { getCommerceProvider, useCommerce as useCoreCommerce } from '@vercel/commerce'
+import {
+ getCommerceProvider,
+ useCommerce as useCoreCommerce,
+} from '@vercel/commerce'
import { saleorProvider, SaleorProvider } from './provider'
export { saleorProvider }
diff --git a/packages/saleor/src/product/use-search.tsx b/packages/saleor/src/product/use-search.tsx
index 69212cba1..546e38732 100644
--- a/packages/saleor/src/product/use-search.tsx
+++ b/packages/saleor/src/product/use-search.tsx
@@ -51,7 +51,9 @@ export const handler: SWRHook = {
}
return {
- products: edges.map(({ node }: ProductCountableEdge) => normalizeProduct(node)),
+ products: edges.map(({ node }: ProductCountableEdge) =>
+ normalizeProduct(node)
+ ),
found: !!edges.length,
}
},
diff --git a/packages/saleor/src/utils/checkout-attach.ts b/packages/saleor/src/utils/checkout-attach.ts
index c7ab44ab0..9161a2176 100644
--- a/packages/saleor/src/utils/checkout-attach.ts
+++ b/packages/saleor/src/utils/checkout-attach.ts
@@ -1,7 +1,10 @@
import * as mutation from './mutations'
import { CheckoutCustomerAttach } from '../../schema'
-export const checkoutAttach = async (fetch: any, { variables, headers }: any): Promise => {
+export const checkoutAttach = async (
+ fetch: any,
+ { variables, headers }: any
+): Promise => {
const data = await fetch({
query: mutation.CheckoutAttach,
variables,
diff --git a/packages/saleor/src/utils/customer-token.ts b/packages/saleor/src/utils/customer-token.ts
index dd15fbe25..0cdd2ebb3 100644
--- a/packages/saleor/src/utils/customer-token.ts
+++ b/packages/saleor/src/utils/customer-token.ts
@@ -12,11 +12,18 @@ export const setCSRFToken = (token?: string, options?: CookieAttributes) => {
}
export const getCheckoutToken = () => Cookies.get(Const.CHECKOUT_ID_COOKIE)
-export const setCheckoutToken = (token?: string, options?: CookieAttributes) => {
+export const setCheckoutToken = (
+ token?: string,
+ options?: CookieAttributes
+) => {
setCookie(Const.CHECKOUT_ID_COOKIE, token, options)
}
-const setCookie = (name: string, token?: string, options?: CookieAttributes) => {
+const setCookie = (
+ name: string,
+ token?: string,
+ options?: CookieAttributes
+) => {
if (!token) {
Cookies.remove(name)
} else {
diff --git a/packages/saleor/src/utils/get-categories.ts b/packages/saleor/src/utils/get-categories.ts
index e2cc72533..7a423a07b 100644
--- a/packages/saleor/src/utils/get-categories.ts
+++ b/packages/saleor/src/utils/get-categories.ts
@@ -11,12 +11,14 @@ const getCategories = async (config: SaleorConfig): Promise => {
})
return (
- data.collections?.edges?.map(({ node: { id, name, slug } }: CollectionCountableEdge) => ({
- id,
- name,
- slug,
- path: `/${slug}`,
- })) ?? []
+ data.collections?.edges?.map(
+ ({ node: { id, name, slug } }: CollectionCountableEdge) => ({
+ id,
+ name,
+ slug,
+ path: `/${slug}`,
+ })
+ ) ?? []
)
}
diff --git a/packages/saleor/src/utils/get-search-variables.ts b/packages/saleor/src/utils/get-search-variables.ts
index 5adf938e8..9b1909879 100644
--- a/packages/saleor/src/utils/get-search-variables.ts
+++ b/packages/saleor/src/utils/get-search-variables.ts
@@ -1,7 +1,12 @@
import { getSortVariables } from './get-sort-variables'
import type { SearchProductsInput } from '../product/use-search'
-export const getSearchVariables = ({ brandId, search, categoryId, sort }: SearchProductsInput) => {
+export const getSearchVariables = ({
+ brandId,
+ search,
+ categoryId,
+ sort,
+}: SearchProductsInput) => {
const sortBy = {
field: 'NAME',
direction: 'ASC',
diff --git a/packages/saleor/src/utils/get-sort-variables.ts b/packages/saleor/src/utils/get-sort-variables.ts
index fe040a0a5..0034a2bd3 100644
--- a/packages/saleor/src/utils/get-sort-variables.ts
+++ b/packages/saleor/src/utils/get-sort-variables.ts
@@ -1,4 +1,7 @@
-export const getSortVariables = (sort?: string, isCategory: boolean = false) => {
+export const getSortVariables = (
+ sort?: string,
+ isCategory: boolean = false
+) => {
let output = {}
switch (sort) {
case 'price-asc':
diff --git a/packages/saleor/src/utils/mutations/checkout-create.ts b/packages/saleor/src/utils/mutations/checkout-create.ts
index 3cfe9d480..e07fb37e3 100644
--- a/packages/saleor/src/utils/mutations/checkout-create.ts
+++ b/packages/saleor/src/utils/mutations/checkout-create.ts
@@ -2,7 +2,13 @@ import * as fragment from '../fragments'
export const CheckoutCreate = /* GraphQL */ `
mutation CheckoutCreate {
- checkoutCreate(input: { email: "customer@example.com", lines: [], channel: "default-channel" }) {
+ checkoutCreate(
+ input: {
+ email: "customer@example.com"
+ lines: []
+ channel: "default-channel"
+ }
+ ) {
errors {
code
field
diff --git a/packages/saleor/src/utils/mutations/checkout-line-add.ts b/packages/saleor/src/utils/mutations/checkout-line-add.ts
index e7b8e0a27..bf388adda 100644
--- a/packages/saleor/src/utils/mutations/checkout-line-add.ts
+++ b/packages/saleor/src/utils/mutations/checkout-line-add.ts
@@ -1,7 +1,10 @@
import * as fragment from '../fragments'
export const CheckoutLineAdd = /* GraphQL */ `
- mutation CheckoutLineAdd($checkoutId: ID!, $lineItems: [CheckoutLineInput!]!) {
+ mutation CheckoutLineAdd(
+ $checkoutId: ID!
+ $lineItems: [CheckoutLineInput!]!
+ ) {
checkoutLinesAdd(checkoutId: $checkoutId, lines: $lineItems) {
errors {
code
diff --git a/packages/saleor/src/utils/mutations/checkout-line-update.ts b/packages/saleor/src/utils/mutations/checkout-line-update.ts
index 50019d6ef..c55f926cf 100644
--- a/packages/saleor/src/utils/mutations/checkout-line-update.ts
+++ b/packages/saleor/src/utils/mutations/checkout-line-update.ts
@@ -1,7 +1,10 @@
import * as fragment from '../fragments'
export const CheckoutLineUpdate = /* GraphQL */ `
- mutation CheckoutLineUpdate($checkoutId: ID!, $lineItems: [CheckoutLineInput!]!) {
+ mutation CheckoutLineUpdate(
+ $checkoutId: ID!
+ $lineItems: [CheckoutLineInput!]!
+ ) {
checkoutLinesUpdate(checkoutId: $checkoutId, lines: $lineItems) {
errors {
code
diff --git a/packages/saleor/src/utils/normalize.ts b/packages/saleor/src/utils/normalize.ts
index a4ff4b52c..0608aacac 100644
--- a/packages/saleor/src/utils/normalize.ts
+++ b/packages/saleor/src/utils/normalize.ts
@@ -1,6 +1,12 @@
import { Product } from '@vercel/commerce/types/product'
-import { Product as SaleorProduct, Checkout, CheckoutLine, Money, ProductVariant } from '../../schema'
+import {
+ Product as SaleorProduct,
+ Checkout,
+ CheckoutLine,
+ Money,
+ ProductVariant,
+} from '../../schema'
import type { Cart, LineItem } from '../types'
@@ -19,7 +25,9 @@ const normalizeProductOptions = (options: ProductVariant[]) => {
?.map((option) => option?.attributes)
.flat(1)
.reduce((acc, x) => {
- if (acc.find(({ displayName }: any) => displayName === x.attribute.name)) {
+ if (
+ acc.find(({ displayName }: any) => displayName === x.attribute.name)
+ ) {
return acc.map((opt: any) => {
return opt.displayName === x.attribute.name
? {
@@ -64,23 +72,41 @@ const normalizeProductVariants = (variants: ProductVariant[]) => {
}
export function normalizeProduct(productNode: SaleorProduct): Product {
- const { id, name, media = [], variants, description, slug, pricing, ...rest } = productNode
+ const {
+ id,
+ name,
+ media = [],
+ variants,
+ description,
+ slug,
+ pricing,
+ ...rest
+ } = productNode
const product = {
id,
name,
vendor: '',
- description: description ? JSON.parse(description)?.blocks[0]?.data.text : '',
+ description: description
+ ? JSON.parse(description)?.blocks[0]?.data.text
+ : '',
path: `/${slug}`,
slug: slug?.replace(/^\/+|\/+$/g, ''),
- price: (pricing?.priceRange?.start?.net && money(pricing.priceRange.start.net)) || {
+ price: (pricing?.priceRange?.start?.net &&
+ money(pricing.priceRange.start.net)) || {
value: 0,
currencyCode: 'USD',
},
// TODO: Check nextjs-commerce bug if no images are added for a product
images: media?.length ? media : [{ url: placeholderImg }],
- variants: variants && variants.length > 0 ? normalizeProductVariants(variants as ProductVariant[]) : [],
- options: variants && variants.length > 0 ? normalizeProductOptions(variants as ProductVariant[]) : [],
+ variants:
+ variants && variants.length > 0
+ ? normalizeProductVariants(variants as ProductVariant[])
+ : [],
+ options:
+ variants && variants.length > 0
+ ? normalizeProductOptions(variants as ProductVariant[])
+ : [],
...rest,
}
@@ -89,7 +115,8 @@ export function normalizeProduct(productNode: SaleorProduct): Product {
export function normalizeCart(checkout: Checkout): Cart {
const lines = checkout.lines as CheckoutLine[]
- const lineItems: LineItem[] = lines.length > 0 ? lines?.map(normalizeLineItem) : []
+ const lineItems: LineItem[] =
+ lines.length > 0 ? lines?.map(normalizeLineItem) : []
return {
id: checkout.id,
diff --git a/packages/saleor/src/utils/queries/collection-one.ts b/packages/saleor/src/utils/queries/collection-one.ts
index c2e593f51..5771a5aaf 100644
--- a/packages/saleor/src/utils/queries/collection-one.ts
+++ b/packages/saleor/src/utils/queries/collection-one.ts
@@ -1,7 +1,11 @@
import * as fragment from '../fragments'
export const CollectionOne = /* GraphQL */ `
- query getProductsFromCollection($categoryId: ID!, $first: Int = 100, $channel: String = "default-channel") {
+ query getProductsFromCollection(
+ $categoryId: ID!
+ $first: Int = 100
+ $channel: String = "default-channel"
+ ) {
collection(id: $categoryId, channel: $channel) {
id
products(first: $first) {
diff --git a/packages/saleor/src/utils/queries/get-all-products-paths-query.ts b/packages/saleor/src/utils/queries/get-all-products-paths-query.ts
index d9acb82cf..0933977c5 100644
--- a/packages/saleor/src/utils/queries/get-all-products-paths-query.ts
+++ b/packages/saleor/src/utils/queries/get-all-products-paths-query.ts
@@ -1,5 +1,9 @@
export const getAllProductsPathsQuery = /* GraphQL */ `
- query getAllProductPaths($first: Int = 100, $cursor: String, $channel: String = "default-channel") {
+ query getAllProductPaths(
+ $first: Int = 100
+ $cursor: String
+ $channel: String = "default-channel"
+ ) {
products(first: $first, after: $cursor, channel: $channel) {
pageInfo {
hasNextPage
diff --git a/packages/saleor/src/utils/queries/product-many.ts b/packages/saleor/src/utils/queries/product-many.ts
index 7e0aa9a07..bfc6b5cc4 100644
--- a/packages/saleor/src/utils/queries/product-many.ts
+++ b/packages/saleor/src/utils/queries/product-many.ts
@@ -7,7 +7,12 @@ export const ProductMany = /* GraphQL */ `
$sortBy: ProductOrder
$channel: String = "default-channel"
) {
- products(first: $first, channel: $channel, filter: $filter, sortBy: $sortBy) {
+ products(
+ first: $first
+ channel: $channel
+ filter: $filter
+ sortBy: $sortBy
+ ) {
...ProductConnection
}
}
diff --git a/packages/saleor/src/utils/throw-user-errors.ts b/packages/saleor/src/utils/throw-user-errors.ts
index 59345e748..b7ac2cbfc 100644
--- a/packages/saleor/src/utils/throw-user-errors.ts
+++ b/packages/saleor/src/utils/throw-user-errors.ts
@@ -1,10 +1,20 @@
import { ValidationError } from '@vercel/commerce/utils/errors'
-import { CheckoutError, CheckoutErrorCode, AppError, AccountError, AccountErrorCode } from '../../schema'
+import {
+ CheckoutError,
+ CheckoutErrorCode,
+ AppError,
+ AccountError,
+ AccountErrorCode,
+} from '../../schema'
export type UserErrors = Array
-export type UserErrorCode = CheckoutErrorCode | AccountErrorCode | null | undefined
+export type UserErrorCode =
+ | CheckoutErrorCode
+ | AccountErrorCode
+ | null
+ | undefined
export const throwUserErrors = (errors?: UserErrors) => {
if (errors && errors.length) {
diff --git a/packages/shopify/schema.d.ts b/packages/shopify/schema.d.ts
index 328f0ff1b..adaa3ef04 100644
--- a/packages/shopify/schema.d.ts
+++ b/packages/shopify/schema.d.ts
@@ -2,10 +2,12 @@ export type Maybe = T | null
export type Exact = {
[K in keyof T]: T[K]
}
-export type MakeOptional = Omit &
- { [SubKey in K]?: Maybe }
-export type MakeMaybe = Omit &
- { [SubKey in K]: Maybe }
+export type MakeOptional = Omit & {
+ [SubKey in K]?: Maybe
+}
+export type MakeMaybe = Omit & {
+ [SubKey in K]: Maybe
+}
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string
diff --git a/packages/swell/schema.d.ts b/packages/swell/schema.d.ts
index 0ec625048..b1dcf3213 100644
--- a/packages/swell/schema.d.ts
+++ b/packages/swell/schema.d.ts
@@ -2,10 +2,12 @@ export type Maybe = T | null
export type Exact = {
[K in keyof T]: T[K]
}
-export type MakeOptional = Omit &
- { [SubKey in K]?: Maybe }
-export type MakeMaybe = Omit &
- { [SubKey in K]: Maybe }
+export type MakeOptional = Omit & {
+ [SubKey in K]?: Maybe
+}
+export type MakeMaybe = Omit & {
+ [SubKey in K]: Maybe
+}
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string
diff --git a/packages/taskr-swc/.prettierrc b/packages/taskr-swc/.prettierrc
index a4fb43a48..e1076edfa 100644
--- a/packages/taskr-swc/.prettierrc
+++ b/packages/taskr-swc/.prettierrc
@@ -1,6 +1,6 @@
{
- "semi": false,
- "singleQuote": true,
- "tabWidth": 2,
- "useTabs": false
+ "semi": false,
+ "singleQuote": true,
+ "tabWidth": 2,
+ "useTabs": false
}
diff --git a/packages/vendure/schema.d.ts b/packages/vendure/schema.d.ts
index 9d6b53c52..dbe52bd94 100644
--- a/packages/vendure/schema.d.ts
+++ b/packages/vendure/schema.d.ts
@@ -2,10 +2,12 @@ export type Maybe = T | null
export type Exact = {
[K in keyof T]: T[K]
}
-export type MakeOptional = Omit &
- { [SubKey in K]?: Maybe }
-export type MakeMaybe = Omit &
- { [SubKey in K]: Maybe }
+export type MakeOptional = Omit & {
+ [SubKey in K]?: Maybe
+}
+export type MakeMaybe = Omit & {
+ [SubKey in K]: Maybe
+}
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string
diff --git a/packages/vendure/src/next.config.cjs b/packages/vendure/src/next.config.cjs
index 2e6842f00..289ca7a77 100644
--- a/packages/vendure/src/next.config.cjs
+++ b/packages/vendure/src/next.config.cjs
@@ -3,6 +3,6 @@ const commerce = require('./commerce.config.json')
module.exports = {
commerce,
images: {
- domains: ['localhost', 'demo.vendure.io','readonlydemo.vendure.io'],
+ domains: ['localhost', 'demo.vendure.io', 'readonlydemo.vendure.io'],
},
}
diff --git a/site/.prettierrc b/site/.prettierrc
index e1076edfa..17a99e4b1 100644
--- a/site/.prettierrc
+++ b/site/.prettierrc
@@ -1,5 +1,5 @@
{
- "semi": false,
+ "semi": true,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false
diff --git a/site/commerce-config.js b/site/commerce-config.js
index d52797e51..41c34789a 100644
--- a/site/commerce-config.js
+++ b/site/commerce-config.js
@@ -2,11 +2,11 @@
* This file is expected to be used in next.config.js only
*/
-const path = require('path')
-const fs = require('fs')
-const merge = require('deepmerge')
-const prettier = require('prettier')
-const core = require('@vercel/commerce/config')
+const path = require('path');
+const fs = require('fs');
+const merge = require('deepmerge');
+const prettier = require('prettier');
+const core = require('@vercel/commerce/config');
const PROVIDERS = [
'@vercel/commerce-local',
@@ -19,7 +19,7 @@ const PROVIDERS = [
'@vercel/commerce-kibocommerce',
'@vercel/commerce-spree',
'@vercel/commerce-commercejs',
-]
+];
function getProviderName() {
return (
@@ -31,28 +31,28 @@ function getProviderName() {
: process.env.NEXT_PUBLIC_SWELL_STORE_ID
? '@vercel/commerce-swell'
: '@vercel/commerce-local')
- )
+ );
}
function withCommerceConfig(nextConfig = {}) {
const config = merge(
{ commerce: { provider: getProviderName() } },
nextConfig
- )
- const { commerce } = config
- const { provider } = commerce
+ );
+ const { commerce } = config;
+ const { provider } = commerce;
if (!provider) {
throw new Error(
`The commerce provider is missing, please add a valid provider name or its environment variables`
- )
+ );
}
if (!PROVIDERS.includes(provider)) {
throw new Error(
`The commerce provider "${provider}" can't be found, please use one of "${PROVIDERS.join(
', '
)}"`
- )
+ );
}
// Update paths in `tsconfig.json` to point to the selected provider
@@ -60,26 +60,29 @@ function withCommerceConfig(nextConfig = {}) {
const tsconfigPath = path.join(
process.cwd(),
commerce.tsconfigPath || 'tsconfig.json'
- )
- const tsconfig = require(tsconfigPath)
+ );
+ const tsconfig = require(tsconfigPath);
// The module path is a symlink in node_modules
// -> /node_modules/[name]/dist/index.js
- const absolutePath = require.resolve(provider)
+ const absolutePath = require.resolve(provider);
// but we want references to go to the real path in /packages instead
// -> packages/[name]/dist
- const distPath = path.join(path.relative(process.cwd(), absolutePath), '..')
+ const distPath = path.join(
+ path.relative(process.cwd(), absolutePath),
+ '..'
+ );
// -> /packages/[name]/src
- const modulePath = path.join(distPath, '../src')
+ const modulePath = path.join(distPath, '../src');
- tsconfig.compilerOptions.paths['@framework'] = [`${modulePath}`]
- tsconfig.compilerOptions.paths['@framework/*'] = [`${modulePath}/*`]
+ tsconfig.compilerOptions.paths['@framework'] = [`${modulePath}`];
+ tsconfig.compilerOptions.paths['@framework/*'] = [`${modulePath}/*`];
fs.writeFileSync(
tsconfigPath,
prettier.format(JSON.stringify(tsconfig), { parser: 'json' })
- )
+ );
- const webpack = config.webpack
+ const webpack = config.webpack;
// To improve the DX of using references, we'll switch from `src` to `dist`
// only for webpack so imports resolve correctly but typechecking goes to `src`
@@ -87,19 +90,19 @@ function withCommerceConfig(nextConfig = {}) {
if (Array.isArray(cfg.resolve.plugins)) {
const jsconfigPaths = cfg.resolve.plugins.find(
(plugin) => plugin.constructor.name === 'JsConfigPathsPlugin'
- )
+ );
if (jsconfigPaths) {
- jsconfigPaths.paths['@framework'] = [distPath]
- jsconfigPaths.paths['@framework/*'] = [`${distPath}/*`]
+ jsconfigPaths.paths['@framework'] = [distPath];
+ jsconfigPaths.paths['@framework/*'] = [`${distPath}/*`];
}
}
- return webpack ? webpack(cfg, options) : cfg
- }
+ return webpack ? webpack(cfg, options) : cfg;
+ };
}
- return core.withCommerceConfig(config)
+ return core.withCommerceConfig(config);
}
-module.exports = { withCommerceConfig, getProviderName }
+module.exports = { withCommerceConfig, getProviderName };
diff --git a/site/components/auth/ForgotPassword.tsx b/site/components/auth/ForgotPassword.tsx
index dbac371c7..05a6951d7 100644
--- a/site/components/auth/ForgotPassword.tsx
+++ b/site/components/auth/ForgotPassword.tsx
@@ -1,39 +1,39 @@
-import { FC, useEffect, useState, useCallback } from 'react'
-import { validate } from 'email-validator'
-import { useUI } from '@components/ui/context'
-import { Logo, Button, Input } from '@components/ui'
+import { FC, useEffect, useState, useCallback } from 'react';
+import { validate } from 'email-validator';
+import { useUI } from '@components/ui/context';
+import { Logo, Button, Input } from '@components/ui';
interface Props {}
const ForgotPassword: FC = () => {
// Form State
- const [email, setEmail] = useState('')
- const [loading, setLoading] = useState(false)
- const [message, setMessage] = useState('')
- const [dirty, setDirty] = useState(false)
- const [disabled, setDisabled] = useState(false)
+ const [email, setEmail] = useState('');
+ const [loading, setLoading] = useState(false);
+ const [message, setMessage] = useState('');
+ const [dirty, setDirty] = useState(false);
+ const [disabled, setDisabled] = useState(false);
- const { setModalView, closeModal } = useUI()
+ const { setModalView, closeModal } = useUI();
const handleResetPassword = async (e: React.SyntheticEvent) => {
- e.preventDefault()
+ e.preventDefault();
if (!dirty && !disabled) {
- setDirty(true)
- handleValidation()
+ setDirty(true);
+ handleValidation();
}
- }
+ };
const handleValidation = useCallback(() => {
// Unable to send form unless fields are valid.
if (dirty) {
- setDisabled(!validate(email))
+ setDisabled(!validate(email));
}
- }, [email, dirty])
+ }, [email, dirty]);
useEffect(() => {
- handleValidation()
- }, [handleValidation])
+ handleValidation();
+ }, [handleValidation]);
return (
- )
-}
+ );
+};
-export default ForgotPassword
+export default ForgotPassword;
diff --git a/site/components/auth/LoginView.tsx b/site/components/auth/LoginView.tsx
index 3c8faef7c..3608fd42e 100644
--- a/site/components/auth/LoginView.tsx
+++ b/site/components/auth/LoginView.tsx
@@ -1,58 +1,58 @@
-import { FC, useEffect, useState, useCallback } from 'react'
-import { Logo, Button, Input } from '@components/ui'
-import useLogin from '@framework/auth/use-login'
-import { useUI } from '@components/ui/context'
-import { validate } from 'email-validator'
+import { FC, useEffect, useState, useCallback } from 'react';
+import { Logo, Button, Input } from '@components/ui';
+import useLogin from '@framework/auth/use-login';
+import { useUI } from '@components/ui/context';
+import { validate } from 'email-validator';
const LoginView: React.FC = () => {
// Form State
- const [email, setEmail] = useState('')
- const [password, setPassword] = useState('')
- const [loading, setLoading] = useState(false)
- const [message, setMessage] = useState('')
- const [dirty, setDirty] = useState(false)
- const [disabled, setDisabled] = useState(false)
- const { setModalView, closeModal } = useUI()
+ const [email, setEmail] = useState('');
+ const [password, setPassword] = useState('');
+ const [loading, setLoading] = useState(false);
+ const [message, setMessage] = useState('');
+ const [dirty, setDirty] = useState(false);
+ const [disabled, setDisabled] = useState(false);
+ const { setModalView, closeModal } = useUI();
- const login = useLogin()
+ const login = useLogin();
const handleLogin = async (e: React.SyntheticEvent) => {
- e.preventDefault()
+ e.preventDefault();
if (!dirty && !disabled) {
- setDirty(true)
- handleValidation()
+ setDirty(true);
+ handleValidation();
}
try {
- setLoading(true)
- setMessage('')
+ setLoading(true);
+ setMessage('');
await login({
email,
password,
- })
- setLoading(false)
- closeModal()
+ });
+ setLoading(false);
+ closeModal();
} catch (e: any) {
- setMessage(e.errors[0].message)
- setLoading(false)
- setDisabled(false)
+ setMessage(e.errors[0].message);
+ setLoading(false);
+ setDisabled(false);
}
- }
+ };
const handleValidation = useCallback(() => {
// Test for Alphanumeric password
- const validPassword = /^(?=.*[a-zA-Z])(?=.*[0-9])/.test(password)
+ const validPassword = /^(?=.*[a-zA-Z])(?=.*[0-9])/.test(password);
// Unable to send form unless fields are valid.
if (dirty) {
- setDisabled(!validate(email) || password.length < 7 || !validPassword)
+ setDisabled(!validate(email) || password.length < 7 || !validPassword);
}
- }, [email, password, dirty])
+ }, [email, password, dirty]);
useEffect(() => {
- handleValidation()
- }, [handleValidation])
+ handleValidation();
+ }, [handleValidation]);
return (
- )
-}
+ );
+};
-export default LoginView
+export default LoginView;
diff --git a/site/components/auth/SignUpView.tsx b/site/components/auth/SignUpView.tsx
index a85a3bc27..8890a3a52 100644
--- a/site/components/auth/SignUpView.tsx
+++ b/site/components/auth/SignUpView.tsx
@@ -1,64 +1,64 @@
-import { FC, useEffect, useState, useCallback } from 'react'
-import { validate } from 'email-validator'
-import { Info } from '@components/icons'
-import { useUI } from '@components/ui/context'
-import { Logo, Button, Input } from '@components/ui'
-import useSignup from '@framework/auth/use-signup'
+import { FC, useEffect, useState, useCallback } from 'react';
+import { validate } from 'email-validator';
+import { Info } from '@components/icons';
+import { useUI } from '@components/ui/context';
+import { Logo, Button, Input } from '@components/ui';
+import useSignup from '@framework/auth/use-signup';
interface Props {}
const SignUpView: FC = () => {
// Form State
- const [email, setEmail] = useState('')
- const [password, setPassword] = useState('')
- const [firstName, setFirstName] = useState('')
- const [lastName, setLastName] = useState('')
- const [loading, setLoading] = useState(false)
- const [message, setMessage] = useState('')
- const [dirty, setDirty] = useState(false)
- const [disabled, setDisabled] = useState(false)
+ const [email, setEmail] = useState('');
+ const [password, setPassword] = useState('');
+ const [firstName, setFirstName] = useState('');
+ const [lastName, setLastName] = useState('');
+ const [loading, setLoading] = useState(false);
+ const [message, setMessage] = useState('');
+ const [dirty, setDirty] = useState(false);
+ const [disabled, setDisabled] = useState(false);
- const signup = useSignup()
- const { setModalView, closeModal } = useUI()
+ const signup = useSignup();
+ const { setModalView, closeModal } = useUI();
const handleSignup = async (e: React.SyntheticEvent) => {
- e.preventDefault()
+ e.preventDefault();
if (!dirty && !disabled) {
- setDirty(true)
- handleValidation()
+ setDirty(true);
+ handleValidation();
}
try {
- setLoading(true)
- setMessage('')
+ setLoading(true);
+ setMessage('');
await signup({
email,
firstName,
lastName,
password,
- })
- setLoading(false)
- closeModal()
+ });
+ setLoading(false);
+ closeModal();
} catch ({ errors }) {
- setMessage(errors[0].message)
- setLoading(false)
+ setMessage(errors[0].message);
+ setLoading(false);
}
- }
+ };
const handleValidation = useCallback(() => {
// Test for Alphanumeric password
- const validPassword = /^(?=.*[a-zA-Z])(?=.*[0-9])/.test(password)
+ const validPassword = /^(?=.*[a-zA-Z])(?=.*[0-9])/.test(password);
// Unable to send form unless fields are valid.
if (dirty) {
- setDisabled(!validate(email) || password.length < 7 || !validPassword)
+ setDisabled(!validate(email) || password.length < 7 || !validPassword);
}
- }, [email, password, dirty])
+ }, [email, password, dirty]);
useEffect(() => {
- handleValidation()
- }, [handleValidation])
+ handleValidation();
+ }, [handleValidation]);
return (
- )
-}
+ );
+};
-export default SignUpView
+export default SignUpView;
diff --git a/site/components/auth/index.ts b/site/components/auth/index.ts
index 11571fac7..7acb93c6f 100644
--- a/site/components/auth/index.ts
+++ b/site/components/auth/index.ts
@@ -1,3 +1,3 @@
-export { default as LoginView } from './LoginView'
-export { default as SignUpView } from './SignUpView'
-export { default as ForgotPassword } from './ForgotPassword'
+export { default as LoginView } from './LoginView';
+export { default as SignUpView } from './SignUpView';
+export { default as ForgotPassword } from './ForgotPassword';
diff --git a/site/components/cart/CartItem/CartItem.tsx b/site/components/cart/CartItem/CartItem.tsx
index ecd3e39ae..3c9b43b4c 100644
--- a/site/components/cart/CartItem/CartItem.tsx
+++ b/site/components/cart/CartItem/CartItem.tsx
@@ -1,23 +1,23 @@
-import { ChangeEvent, FocusEventHandler, useEffect, useState } from 'react'
-import cn from 'clsx'
-import Image from 'next/image'
-import Link from 'next/link'
-import s from './CartItem.module.css'
-import { useUI } from '@components/ui/context'
-import type { LineItem } from '@commerce/types/cart'
-import usePrice from '@framework/product/use-price'
-import useUpdateItem from '@framework/cart/use-update-item'
-import useRemoveItem from '@framework/cart/use-remove-item'
-import Quantity from '@components/ui/Quantity'
+import { ChangeEvent, FocusEventHandler, useEffect, useState } from 'react';
+import cn from 'clsx';
+import Image from 'next/image';
+import Link from 'next/link';
+import s from './CartItem.module.css';
+import { useUI } from '@components/ui/context';
+import type { LineItem } from '@commerce/types/cart';
+import usePrice from '@framework/product/use-price';
+import useUpdateItem from '@framework/cart/use-update-item';
+import useRemoveItem from '@framework/cart/use-remove-item';
+import Quantity from '@components/ui/Quantity';
type ItemOption = {
- name: string
- nameId: number
- value: string
- valueId: number
-}
+ name: string;
+ nameId: number;
+ value: string;
+ valueId: number;
+};
-const placeholderImg = '/product-img-placeholder.svg'
+const placeholderImg = '/product-img-placeholder.svg';
const CartItem = ({
item,
@@ -25,56 +25,56 @@ const CartItem = ({
currencyCode,
...rest
}: {
- variant?: 'default' | 'display'
- item: LineItem
- currencyCode: string
+ variant?: 'default' | 'display';
+ item: LineItem;
+ currencyCode: string;
}) => {
- const { closeSidebarIfPresent } = useUI()
- const [removing, setRemoving] = useState(false)
- const [quantity, setQuantity] = useState(item.quantity)
- const removeItem = useRemoveItem()
- const updateItem = useUpdateItem({ item })
+ const { closeSidebarIfPresent } = useUI();
+ const [removing, setRemoving] = useState(false);
+ const [quantity, setQuantity] = useState(item.quantity);
+ const removeItem = useRemoveItem();
+ const updateItem = useUpdateItem({ item });
const { price } = usePrice({
amount: item.variant.price * item.quantity,
baseAmount: item.variant.listPrice * item.quantity,
currencyCode,
- })
+ });
const handleChange = async ({
target: { value },
}: ChangeEvent) => {
- setQuantity(Number(value))
- await updateItem({ quantity: Number(value) })
- }
+ setQuantity(Number(value));
+ await updateItem({ quantity: Number(value) });
+ };
const increaseQuantity = async (n = 1) => {
- const val = Number(quantity) + n
- setQuantity(val)
- await updateItem({ quantity: val })
- }
+ const val = Number(quantity) + n;
+ setQuantity(val);
+ await updateItem({ quantity: val });
+ };
const handleRemove = async () => {
- setRemoving(true)
+ setRemoving(true);
try {
- await removeItem(item)
+ await removeItem(item);
} catch (error) {
- setRemoving(false)
+ setRemoving(false);
}
- }
+ };
// TODO: Add a type for this
- const options = (item as any).options
+ const options = (item as any).options;
useEffect(() => {
// Reset the quantity state if the item quantity changes
if (item.quantity !== Number(quantity)) {
- setQuantity(item.quantity)
+ setQuantity(item.quantity);
}
// TODO: currently not including quantity in deps is intended, but we should
// do this differently as it could break easily
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [item.quantity])
+ }, [item.quantity]);
return (
@@ -153,7 +153,7 @@ const CartItem = ({
/>
)}
- )
-}
+ );
+};
-export default CartItem
+export default CartItem;
diff --git a/site/components/cart/CartItem/index.ts b/site/components/cart/CartItem/index.ts
index b5f6dc52f..30da1433f 100644
--- a/site/components/cart/CartItem/index.ts
+++ b/site/components/cart/CartItem/index.ts
@@ -1 +1 @@
-export { default } from './CartItem'
+export { default } from './CartItem';
diff --git a/site/components/cart/CartSidebarView/CartSidebarView.tsx b/site/components/cart/CartSidebarView/CartSidebarView.tsx
index 327602c0b..a0bc1e358 100644
--- a/site/components/cart/CartSidebarView/CartSidebarView.tsx
+++ b/site/components/cart/CartSidebarView/CartSidebarView.tsx
@@ -1,36 +1,36 @@
-import cn from 'clsx'
-import Link from 'next/link'
-import { FC } from 'react'
-import s from './CartSidebarView.module.css'
-import CartItem from '../CartItem'
-import { Button, Text } from '@components/ui'
-import { useUI } from '@components/ui/context'
-import { Bag, Cross, Check } from '@components/icons'
-import useCart from '@framework/cart/use-cart'
-import usePrice from '@framework/product/use-price'
-import SidebarLayout from '@components/common/SidebarLayout'
+import cn from 'clsx';
+import Link from 'next/link';
+import { FC } from 'react';
+import s from './CartSidebarView.module.css';
+import CartItem from '../CartItem';
+import { Button, Text } from '@components/ui';
+import { useUI } from '@components/ui/context';
+import { Bag, Cross, Check } from '@components/icons';
+import useCart from '@framework/cart/use-cart';
+import usePrice from '@framework/product/use-price';
+import SidebarLayout from '@components/common/SidebarLayout';
const CartSidebarView: FC = () => {
- const { closeSidebar, setSidebarView } = useUI()
- const { data, isLoading, isEmpty } = useCart()
+ const { closeSidebar, setSidebarView } = useUI();
+ const { data, isLoading, isEmpty } = useCart();
const { price: subTotal } = usePrice(
data && {
amount: Number(data.subtotalPrice),
currencyCode: data.currency.code,
}
- )
+ );
const { price: total } = usePrice(
data && {
amount: Number(data.totalPrice),
currencyCode: data.currency.code,
}
- )
- const handleClose = () => closeSidebar()
- const goToCheckout = () => setSidebarView('CHECKOUT_VIEW')
+ );
+ const handleClose = () => closeSidebar();
+ const goToCheckout = () => setSidebarView('CHECKOUT_VIEW');
- const error = null
- const success = null
+ const error = null;
+ const success = null;
return (
{
>
)}
- )
-}
+ );
+};
-export default CartSidebarView
+export default CartSidebarView;
diff --git a/site/components/cart/CartSidebarView/index.ts b/site/components/cart/CartSidebarView/index.ts
index 0262e448e..643bcfbc0 100644
--- a/site/components/cart/CartSidebarView/index.ts
+++ b/site/components/cart/CartSidebarView/index.ts
@@ -1 +1 @@
-export { default } from './CartSidebarView'
+export { default } from './CartSidebarView';
diff --git a/site/components/cart/index.ts b/site/components/cart/index.ts
index 3e53fa34a..1e6204717 100644
--- a/site/components/cart/index.ts
+++ b/site/components/cart/index.ts
@@ -1,2 +1,2 @@
-export { default as CartSidebarView } from './CartSidebarView'
-export { default as CartItem } from './CartItem'
+export { default as CartSidebarView } from './CartSidebarView';
+export { default as CartItem } from './CartItem';
diff --git a/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx b/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx
index 21a20c429..436bd8a65 100644
--- a/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx
+++ b/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx
@@ -1,37 +1,37 @@
-import Link from 'next/link'
-import { FC, useState } from 'react'
-import CartItem from '@components/cart/CartItem'
-import { Button, Text } from '@components/ui'
-import { useUI } from '@components/ui/context'
-import SidebarLayout from '@components/common/SidebarLayout'
-import useCart from '@framework/cart/use-cart'
-import usePrice from '@framework/product/use-price'
-import useCheckout from '@framework/checkout/use-checkout'
-import ShippingWidget from '../ShippingWidget'
-import PaymentWidget from '../PaymentWidget'
-import s from './CheckoutSidebarView.module.css'
-import { useCheckoutContext } from '../context'
+import Link from 'next/link';
+import { FC, useState } from 'react';
+import CartItem from '@components/cart/CartItem';
+import { Button, Text } from '@components/ui';
+import { useUI } from '@components/ui/context';
+import SidebarLayout from '@components/common/SidebarLayout';
+import useCart from '@framework/cart/use-cart';
+import usePrice from '@framework/product/use-price';
+import useCheckout from '@framework/checkout/use-checkout';
+import ShippingWidget from '../ShippingWidget';
+import PaymentWidget from '../PaymentWidget';
+import s from './CheckoutSidebarView.module.css';
+import { useCheckoutContext } from '../context';
const CheckoutSidebarView: FC = () => {
- const [loadingSubmit, setLoadingSubmit] = useState(false)
- const { setSidebarView, closeSidebar } = useUI()
- const { data: cartData, mutate: refreshCart } = useCart()
- const { data: checkoutData, submit: onCheckout } = useCheckout()
- const { clearCheckoutFields } = useCheckoutContext()
+ const [loadingSubmit, setLoadingSubmit] = useState(false);
+ const { setSidebarView, closeSidebar } = useUI();
+ const { data: cartData, mutate: refreshCart } = useCart();
+ const { data: checkoutData, submit: onCheckout } = useCheckout();
+ const { clearCheckoutFields } = useCheckoutContext();
async function handleSubmit(event: React.ChangeEvent) {
try {
- setLoadingSubmit(true)
- event.preventDefault()
+ setLoadingSubmit(true);
+ event.preventDefault();
- await onCheckout()
- clearCheckoutFields()
- setLoadingSubmit(false)
- refreshCart()
- closeSidebar()
+ await onCheckout();
+ clearCheckoutFields();
+ setLoadingSubmit(false);
+ refreshCart();
+ closeSidebar();
} catch {
// TODO - handle error UI here.
- setLoadingSubmit(false)
+ setLoadingSubmit(false);
}
}
@@ -40,13 +40,13 @@ const CheckoutSidebarView: FC = () => {
amount: Number(cartData.subtotalPrice),
currencyCode: cartData.currency.code,
}
- )
+ );
const { price: total } = usePrice(
cartData && {
amount: Number(cartData.totalPrice),
currencyCode: cartData.currency.code,
}
- )
+ );
return (
{
- )
-}
+ );
+};
-export default CheckoutSidebarView
+export default CheckoutSidebarView;
diff --git a/site/components/checkout/CheckoutSidebarView/index.ts b/site/components/checkout/CheckoutSidebarView/index.ts
index 168bc58f4..088d1eed8 100644
--- a/site/components/checkout/CheckoutSidebarView/index.ts
+++ b/site/components/checkout/CheckoutSidebarView/index.ts
@@ -1 +1 @@
-export { default } from './CheckoutSidebarView'
+export { default } from './CheckoutSidebarView';
diff --git a/site/components/checkout/PaymentMethodView/PaymentMethodView.tsx b/site/components/checkout/PaymentMethodView/PaymentMethodView.tsx
index 115619c75..ee8f104ac 100644
--- a/site/components/checkout/PaymentMethodView/PaymentMethodView.tsx
+++ b/site/components/checkout/PaymentMethodView/PaymentMethodView.tsx
@@ -1,33 +1,33 @@
-import { FC } from 'react'
-import cn from 'clsx'
+import { FC } from 'react';
+import cn from 'clsx';
-import useAddCard from '@framework/customer/card/use-add-item'
-import { Button, Text } from '@components/ui'
-import { useUI } from '@components/ui/context'
-import SidebarLayout from '@components/common/SidebarLayout'
+import useAddCard from '@framework/customer/card/use-add-item';
+import { Button, Text } from '@components/ui';
+import { useUI } from '@components/ui/context';
+import SidebarLayout from '@components/common/SidebarLayout';
-import s from './PaymentMethodView.module.css'
+import s from './PaymentMethodView.module.css';
interface Form extends HTMLFormElement {
- cardHolder: HTMLInputElement
- cardNumber: HTMLInputElement
- cardExpireDate: HTMLInputElement
- cardCvc: HTMLInputElement
- firstName: HTMLInputElement
- lastName: HTMLInputElement
- company: HTMLInputElement
- streetNumber: HTMLInputElement
- zipCode: HTMLInputElement
- city: HTMLInputElement
- country: HTMLSelectElement
+ cardHolder: HTMLInputElement;
+ cardNumber: HTMLInputElement;
+ cardExpireDate: HTMLInputElement;
+ cardCvc: HTMLInputElement;
+ firstName: HTMLInputElement;
+ lastName: HTMLInputElement;
+ company: HTMLInputElement;
+ streetNumber: HTMLInputElement;
+ zipCode: HTMLInputElement;
+ city: HTMLInputElement;
+ country: HTMLSelectElement;
}
const PaymentMethodView: FC = () => {
- const { setSidebarView } = useUI()
- const addCard = useAddCard()
+ const { setSidebarView } = useUI();
+ const addCard = useAddCard();
async function handleSubmit(event: React.ChangeEvent
- )
-}
+ );
+};
-export default PaymentMethodView
+export default PaymentMethodView;
diff --git a/site/components/checkout/PaymentMethodView/index.ts b/site/components/checkout/PaymentMethodView/index.ts
index 951b3c318..69df1c0f4 100644
--- a/site/components/checkout/PaymentMethodView/index.ts
+++ b/site/components/checkout/PaymentMethodView/index.ts
@@ -1 +1 @@
-export { default } from './PaymentMethodView'
+export { default } from './PaymentMethodView';
diff --git a/site/components/checkout/PaymentWidget/PaymentWidget.tsx b/site/components/checkout/PaymentWidget/PaymentWidget.tsx
index 9b496bb44..b04cf8309 100644
--- a/site/components/checkout/PaymentWidget/PaymentWidget.tsx
+++ b/site/components/checkout/PaymentWidget/PaymentWidget.tsx
@@ -1,10 +1,10 @@
-import { FC } from 'react'
-import s from './PaymentWidget.module.css'
-import { ChevronRight, CreditCard, Check } from '@components/icons'
+import { FC } from 'react';
+import s from './PaymentWidget.module.css';
+import { ChevronRight, CreditCard, Check } from '@components/icons';
interface ComponentProps {
- onClick?: () => any
- isValid?: boolean
+ onClick?: () => any;
+ isValid?: boolean;
}
const PaymentWidget: FC = ({ onClick, isValid }) => {
@@ -22,7 +22,7 @@ const PaymentWidget: FC = ({ onClick, isValid }) => {
{isValid ? : }
- )
-}
+ );
+};
-export default PaymentWidget
+export default PaymentWidget;
diff --git a/site/components/checkout/PaymentWidget/index.ts b/site/components/checkout/PaymentWidget/index.ts
index 18cadea57..31267ae9e 100644
--- a/site/components/checkout/PaymentWidget/index.ts
+++ b/site/components/checkout/PaymentWidget/index.ts
@@ -1 +1 @@
-export { default } from './PaymentWidget'
+export { default } from './PaymentWidget';
diff --git a/site/components/checkout/ShippingView/ShippingView.tsx b/site/components/checkout/ShippingView/ShippingView.tsx
index ef7c74325..ccbeab075 100644
--- a/site/components/checkout/ShippingView/ShippingView.tsx
+++ b/site/components/checkout/ShippingView/ShippingView.tsx
@@ -1,33 +1,33 @@
-import { FC } from 'react'
-import cn from 'clsx'
+import { FC } from 'react';
+import cn from 'clsx';
-import Button from '@components/ui/Button'
-import { useUI } from '@components/ui/context'
-import SidebarLayout from '@components/common/SidebarLayout'
-import useAddAddress from '@framework/customer/address/use-add-item'
+import Button from '@components/ui/Button';
+import { useUI } from '@components/ui/context';
+import SidebarLayout from '@components/common/SidebarLayout';
+import useAddAddress from '@framework/customer/address/use-add-item';
-import s from './ShippingView.module.css'
+import s from './ShippingView.module.css';
interface Form extends HTMLFormElement {
- cardHolder: HTMLInputElement
- cardNumber: HTMLInputElement
- cardExpireDate: HTMLInputElement
- cardCvc: HTMLInputElement
- firstName: HTMLInputElement
- lastName: HTMLInputElement
- company: HTMLInputElement
- streetNumber: HTMLInputElement
- zipCode: HTMLInputElement
- city: HTMLInputElement
- country: HTMLSelectElement
+ cardHolder: HTMLInputElement;
+ cardNumber: HTMLInputElement;
+ cardExpireDate: HTMLInputElement;
+ cardCvc: HTMLInputElement;
+ firstName: HTMLInputElement;
+ lastName: HTMLInputElement;
+ company: HTMLInputElement;
+ streetNumber: HTMLInputElement;
+ zipCode: HTMLInputElement;
+ city: HTMLInputElement;
+ country: HTMLSelectElement;
}
const ShippingView: FC = () => {
- const { setSidebarView } = useUI()
- const addAddress = useAddAddress()
+ const { setSidebarView } = useUI();
+ const addAddress = useAddAddress();
async function handleSubmit(event: React.ChangeEvent
- )
-}
+ );
+};
-export default ShippingView
+export default ShippingView;
diff --git a/site/components/checkout/ShippingView/index.ts b/site/components/checkout/ShippingView/index.ts
index 428e7e4fe..39adc5473 100644
--- a/site/components/checkout/ShippingView/index.ts
+++ b/site/components/checkout/ShippingView/index.ts
@@ -1 +1 @@
-export { default } from './ShippingView'
+export { default } from './ShippingView';
diff --git a/site/components/checkout/ShippingWidget/ShippingWidget.tsx b/site/components/checkout/ShippingWidget/ShippingWidget.tsx
index 1418a2b51..9b46187ff 100644
--- a/site/components/checkout/ShippingWidget/ShippingWidget.tsx
+++ b/site/components/checkout/ShippingWidget/ShippingWidget.tsx
@@ -1,10 +1,10 @@
-import { FC } from 'react'
-import s from './ShippingWidget.module.css'
-import { ChevronRight, MapPin, Check } from '@components/icons'
+import { FC } from 'react';
+import s from './ShippingWidget.module.css';
+import { ChevronRight, MapPin, Check } from '@components/icons';
interface ComponentProps {
- onClick?: () => any
- isValid?: boolean
+ onClick?: () => any;
+ isValid?: boolean;
}
const ShippingWidget: FC = ({ onClick, isValid }) => {
@@ -25,7 +25,7 @@ const ShippingWidget: FC = ({ onClick, isValid }) => {