diff --git a/.prettierrc b/.prettierrc index e1076edfa..91990a859 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,5 +2,13 @@ "semi": false, "singleQuote": true, "tabWidth": 2, - "useTabs": false + "useTabs": false, + "overrides": [ + { + "files": ["framework/saleor/**/*"], + "options": { + "printWidth": 120 + } + } + ] } diff --git a/assets/base.css b/assets/base.css index dfdaf1475..e63ea1aa4 100644 --- a/assets/base.css +++ b/assets/base.css @@ -127,4 +127,3 @@ a { opacity: 1; } } - diff --git a/assets/components.css b/assets/components.css index 8c4c5a357..ebebcc238 100644 --- a/assets/components.css +++ b/assets/components.css @@ -1,3 +1,3 @@ .fit { min-height: calc(100vh - 88px); -} \ No newline at end of file +} diff --git a/components/common/Layout/Layout.tsx b/components/common/Layout/Layout.tsx index c5de5739a..c84c52693 100644 --- a/components/common/Layout/Layout.tsx +++ b/components/common/Layout/Layout.tsx @@ -49,13 +49,8 @@ const Layout: FC = ({ children, pageProps: { categories = [], ...pageProps }, }) => { - const { - displaySidebar, - displayModal, - closeSidebar, - closeModal, - modalView, - } = useUI() + const { displaySidebar, displayModal, closeSidebar, closeModal, modalView } = + useUI() const { acceptedCookies, onAcceptCookies } = useAcceptCookies() const { locale = 'en-US' } = useRouter() diff --git a/components/product/ProductView/ProductView.tsx b/components/product/ProductView/ProductView.tsx index 6754f23a7..0797d2a3b 100644 --- a/components/product/ProductView/ProductView.tsx +++ b/components/product/ProductView/ProductView.tsx @@ -32,7 +32,7 @@ const ProductView: FC = ({ product }) => { useEffect(() => { // Selects the default option - const options = product.variants[0].options || []; + const options = product.variants[0].options || [] options.forEach((v) => { setChoices((choices) => ({ ...choices, @@ -128,7 +128,8 @@ const ProductView: FC = ({ product }) => { setChoices((choices) => { return { ...choices, - [opt.displayName.toLowerCase()]: v.label.toLowerCase(), + [opt.displayName.toLowerCase()]: + v.label.toLowerCase(), } }) }} diff --git a/components/ui/Container/Container.tsx b/components/ui/Container/Container.tsx index 7b281a2e4..f88934122 100644 --- a/components/ui/Container/Container.tsx +++ b/components/ui/Container/Container.tsx @@ -13,9 +13,8 @@ const Container: FC = ({ children, className, el = 'div', clean }) => { 'mx-auto max-w-8xl px-6': !clean, }) - let Component: React.ComponentType< - React.HTMLAttributes - > = el as any + let Component: React.ComponentType> = + el as any return {children} } diff --git a/framework/commerce/new-provider.md b/framework/commerce/new-provider.md index 58ed686f9..ac6692fbf 100644 --- a/framework/commerce/new-provider.md +++ b/framework/commerce/new-provider.md @@ -157,24 +157,26 @@ export const handler: SWRHook< const data = cartId ? await fetch(options) : null return data && normalizeCart(data) }, - 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] + ) + }, } ``` @@ -218,18 +220,20 @@ export const handler: MutationHook = { return normalizeCart(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/framework/commerce/utils/define-property.ts b/framework/commerce/utils/define-property.ts index e89735226..875aaaa82 100644 --- a/framework/commerce/utils/define-property.ts +++ b/framework/commerce/utils/define-property.ts @@ -11,18 +11,16 @@ type InferValue = Desc extends { ? Record : never -type DefineProperty< - Prop extends PropertyKey, - Desc extends PropertyDescriptor -> = Desc extends { writable: any; set(val: any): any } - ? never - : Desc extends { writable: any; get(): any } - ? never - : Desc extends { writable: false } - ? Readonly> - : Desc extends { writable: true } - ? InferValue - : Readonly> +type DefineProperty = + Desc extends { writable: any; set(val: any): any } + ? never + : Desc extends { writable: any; get(): any } + ? never + : Desc extends { writable: false } + ? Readonly> + : Desc extends { writable: true } + ? InferValue + : Readonly> export default function defineProperty< Obj extends object, diff --git a/framework/saleor/api/index.ts b/framework/saleor/api/index.ts index d04c37390..b3b938401 100644 --- a/framework/saleor/api/index.ts +++ b/framework/saleor/api/index.ts @@ -39,10 +39,10 @@ const config = new Config({ locale: 'en-US', commerceUrl: Const.API_URL, apiToken: Const.SALEOR_TOKEN, - cartCookie: Const.CHECKOUT_ID_COOKIE, + cartCookie: Const.CHECKOUT_ID_COOKIE, cartCookieMaxAge: 60 * 60 * 24 * 30, fetch: fetchGraphqlApi, - customerCookie: "", + customerCookie: '', storeChannel: Const.API_CHANNEL, }) diff --git a/framework/saleor/api/utils/create-api-handler.ts b/framework/saleor/api/utils/create-api-handler.ts index 0e027eecc..73aab4b37 100644 --- a/framework/saleor/api/utils/create-api-handler.ts +++ b/framework/saleor/api/utils/create-api-handler.ts @@ -1,11 +1,7 @@ import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next' import { SaleorConfig, getConfig } from '..' -export type SaleorApiHandler< - T = any, - H extends SaleorHandlers = {}, - Options extends {} = {} -> = ( +export type SaleorApiHandler = ( req: NextApiRequest, res: NextApiResponse>, config: SaleorConfig, @@ -30,11 +26,7 @@ export type SaleorApiResponse = { errors?: { message: string; code?: string }[] } -export default function createApiHandler< - T = any, - H extends SaleorHandlers = {}, - Options extends {} = {} ->( +export default function createApiHandler( handler: SaleorApiHandler, handlers: H, defaultOptions: Options diff --git a/framework/saleor/api/utils/fetch-graphql-api.ts b/framework/saleor/api/utils/fetch-graphql-api.ts index 7cbfe9ff0..324b1061c 100644 --- a/framework/saleor/api/utils/fetch-graphql-api.ts +++ b/framework/saleor/api/utils/fetch-graphql-api.ts @@ -6,14 +6,10 @@ import { getError } from '../../utils/handle-fetch-response' import { getConfig } from '..' import { getToken } from '@framework/utils' -const fetchGraphqlApi: GraphQLFetcher = async ( - query: string, - { variables } = {}, - fetchOptions -) => { +const fetchGraphqlApi: GraphQLFetcher = async (query: string, { variables } = {}, fetchOptions) => { // FIXME @zaiste follow the bigcommerce example const config = getConfig() - const token = getToken(); + const token = getToken() const res = await fetch(API_URL || '', { ...fetchOptions, diff --git a/framework/saleor/api/utils/is-allowed-method.ts b/framework/saleor/api/utils/is-allowed-method.ts index 78bbba568..cbaab2251 100644 --- a/framework/saleor/api/utils/is-allowed-method.ts +++ b/framework/saleor/api/utils/is-allowed-method.ts @@ -1,13 +1,7 @@ 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/framework/saleor/auth/use-login.tsx b/framework/saleor/auth/use-login.tsx index a2d3bc3e0..333b48694 100644 --- a/framework/saleor/auth/use-login.tsx +++ b/framework/saleor/auth/use-login.tsx @@ -4,10 +4,7 @@ import type { MutationHook } from '@commerce/utils/types' import { CommerceError } from '@commerce/utils/errors' import useCustomer from '../customer/use-customer' import * as mutation from '../utils/mutations' -import { - Mutation, - MutationTokenCreateArgs, -} from '../schema' +import { Mutation, MutationTokenCreateArgs } from '../schema' import useLogin, { UseLogin } from '@commerce/auth/use-login' import { setCSRFToken, setToken, throwUserErrors, checkoutAttach, getCheckoutId } from '../utils' @@ -20,48 +17,46 @@ 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', }) } - const { tokenCreate } = await fetch< - Mutation, - MutationTokenCreateArgs - >({ + const { tokenCreate } = await fetch({ ...options, variables: { email, password }, }) throwUserErrors(tokenCreate?.errors) - const { token, csrfToken } = tokenCreate!; + const { token, csrfToken } = tokenCreate! if (token && csrfToken) { setToken(token) setCSRFToken(csrfToken) - - const { checkoutId } = getCheckoutId(); - checkoutAttach(fetch, { + + const { checkoutId } = getCheckoutId() + checkoutAttach(fetch, { variables: { checkoutId }, headers: { - Authorization: `JWT ${token}` - } + Authorization: `JWT ${token}`, + }, }) } return null }, - useHook: ({ fetch }) => () => { - const { revalidate } = useCustomer() + useHook: + ({ fetch }) => + () => { + const { revalidate } = useCustomer() - return useCallback( - async function login(input) { - const data = await fetch({ input }) - await revalidate() - return data - }, - [fetch, revalidate] - ) - }, + return useCallback( + async function login(input) { + const data = await fetch({ input }) + await revalidate() + return data + }, + [fetch, revalidate] + ) + }, } diff --git a/framework/saleor/auth/use-logout.tsx b/framework/saleor/auth/use-logout.tsx index 33c929f5f..e48d7290f 100644 --- a/framework/saleor/auth/use-logout.tsx +++ b/framework/saleor/auth/use-logout.tsx @@ -9,7 +9,7 @@ export default useLogout as UseLogout export const handler: MutationHook = { fetchOptions: { - query: mutation.SessionDestroy, + query: mutation.SessionDestroy, }, async fetcher({ options, fetch }) { await fetch({ @@ -23,16 +23,18 @@ export const handler: MutationHook = { return null }, - useHook: ({ fetch }) => () => { - const { mutate } = useCustomer() + useHook: + ({ fetch }) => + () => { + const { mutate } = useCustomer() - return useCallback( - async function logout() { - const data = await fetch() - await mutate(null, false) - return data - }, - [fetch, mutate] - ) - }, + return useCallback( + async function logout() { + const data = await fetch() + await mutate(null, false) + return data + }, + [fetch, mutate] + ) + }, } diff --git a/framework/saleor/auth/use-signup.tsx b/framework/saleor/auth/use-signup.tsx index c7d5d18f9..d042425c0 100644 --- a/framework/saleor/auth/use-signup.tsx +++ b/framework/saleor/auth/use-signup.tsx @@ -3,42 +3,25 @@ import type { MutationHook } from '@commerce/utils/types' import { CommerceError } from '@commerce/utils/errors' import useSignup, { UseSignup } from '@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' export default useSignup as UseSignup -export const handler: MutationHook< - null, - {}, - AccountRegisterInput, - AccountRegisterInput -> = { +export const handler: MutationHook = { fetchOptions: { - query: mutation.AccountCreate + query: mutation.AccountCreate, }, - async fetcher({ - input: { email, password }, - options, - fetch, - }) { + 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< - Mutation, - MutationAccountRegisterArgs - >({ + const { customerCreate } = await fetch({ ...options, variables: { input: { @@ -53,16 +36,18 @@ export const handler: MutationHook< return null }, - useHook: ({ fetch }) => () => { - const { revalidate } = useCustomer() + useHook: + ({ fetch }) => + () => { + const { revalidate } = useCustomer() - return useCallback( - async function signup(input) { - const data = await fetch({ input }) - await revalidate() - return data - }, - [fetch, revalidate] - ) - }, + return useCallback( + async function signup(input) { + const data = await fetch({ input }) + await revalidate() + return data + }, + [fetch, revalidate] + ) + }, } diff --git a/framework/saleor/cart/use-add-item.tsx b/framework/saleor/cart/use-add-item.tsx index a729b2ad1..f85f5e171 100644 --- a/framework/saleor/cart/use-add-item.tsx +++ b/framework/saleor/cart/use-add-item.tsx @@ -6,10 +6,7 @@ import useCart from './use-cart' import * as mutation from '../utils/mutations' -import { - getCheckoutId, - checkoutToCart, -} from '../utils' +import { getCheckoutId, checkoutToCart } from '../utils' import { Cart, CartItemBody } from '../types' import { Mutation, MutationCheckoutLinesAddArgs } from '../schema' @@ -19,19 +16,13 @@ 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< - Mutation, - MutationCheckoutLinesAddArgs - >({ + const { checkoutLinesAdd } = await fetch({ ...options, variables: { checkoutId: getCheckoutId().checkoutId, @@ -46,16 +37,18 @@ export const handler: MutationHook = { return checkoutToCart(checkoutLinesAdd) }, - 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/framework/saleor/cart/use-cart.tsx b/framework/saleor/cart/use-cart.tsx index 45baf60ce..1f2890d60 100644 --- a/framework/saleor/cart/use-cart.tsx +++ b/framework/saleor/cart/use-cart.tsx @@ -1,8 +1,5 @@ import { useMemo } from 'react' -import useCommerceCart, { - FetchCartInput, - UseCart, -} from '@commerce/cart/use-cart' +import useCommerceCart, { FetchCartInput, UseCart } from '@commerce/cart/use-cart' import { Cart } from '../types' import { SWRHook } from '@commerce/utils/types' @@ -11,12 +8,7 @@ import * as query from '../utils/queries' export default useCommerceCart as UseCart -export const handler: SWRHook< - Cart | null, - {}, - FetchCartInput, - { isEmpty?: boolean } -> = { +export const handler: SWRHook = { fetchOptions: { query: query.CheckoutOne, }, @@ -24,36 +16,38 @@ export const handler: SWRHook< let checkout if (checkoutId) { - const checkoutId = getCheckoutId().checkoutToken; + const checkoutId = getCheckoutId().checkoutToken const data = await fetch({ ...options, variables: { checkoutId }, }) - checkout = data; + checkout = data } if (checkout?.completedAt || !checkoutId) { checkout = await checkoutCreate(fetch) } - return checkoutToCart(checkout); + return checkoutToCart(checkout) }, - 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 + 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 + }, + enumerable: true, }, - enumerable: true, - }, - }), - [response] - ) - }, + }), + [response] + ) + }, } diff --git a/framework/saleor/cart/use-remove-item.tsx b/framework/saleor/cart/use-remove-item.tsx index 8ff661380..ce2ea491a 100644 --- a/framework/saleor/cart/use-remove-item.tsx +++ b/framework/saleor/cart/use-remove-item.tsx @@ -1,20 +1,11 @@ import { useCallback } from 'react' -import type { - MutationHookContext, - HookFetcherContext, -} from '@commerce/utils/types' +import type { MutationHookContext, HookFetcherContext } from '@commerce/utils/types' import { RemoveCartItemBody } from '@commerce/types' import { ValidationError } from '@commerce/utils/errors' -import useRemoveItem, { - RemoveItemInput as RemoveItemInputBase, - UseRemoveItem, -} from '@commerce/cart/use-remove-item' +import useRemoveItem, { RemoveItemInput as RemoveItemInputBase, UseRemoveItem } from '@commerce/cart/use-remove-item' import useCart from './use-cart' import * as mutation from '../utils/mutations' -import { - getCheckoutId, - checkoutToCart, -} from '../utils' +import { getCheckoutId, checkoutToCart } from '../utils' import { Cart, LineItem } from '../types' import { Mutation, MutationCheckoutLineDeleteArgs } from '../schema' @@ -22,51 +13,41 @@ export type RemoveItemFn = T extends LineItem ? (input?: RemoveItemInput) => Promise : (input: RemoveItemInput) => Promise -export type RemoveItemInput = T extends LineItem - ? Partial - : RemoveItemInputBase +export type RemoveItemInput = T extends LineItem ? Partial : RemoveItemInputBase 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: { - checkoutId: getCheckoutId().checkoutId, - lineId: itemId + variables: { + checkoutId: getCheckoutId().checkoutId, + lineId: itemId, }, }) return checkoutToCart(data.checkoutLinesUpdate) }, - 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/framework/saleor/cart/use-update-item.tsx b/framework/saleor/cart/use-update-item.tsx index 4822b1d9a..ae9f7f039 100644 --- a/framework/saleor/cart/use-update-item.tsx +++ b/framework/saleor/cart/use-update-item.tsx @@ -1,14 +1,8 @@ import { useCallback } from 'react' import debounce from 'lodash.debounce' -import type { - HookFetcherContext, - MutationHookContext, -} from '@commerce/utils/types' +import type { HookFetcherContext, MutationHookContext } from '@commerce/utils/types' import { ValidationError } from '@commerce/utils/errors' -import useUpdateItem, { - UpdateItemInput as UpdateItemInputBase, - UseUpdateItem, -} from '@commerce/cart/use-update-item' +import useUpdateItem, { UpdateItemInput as UpdateItemInputBase, UseUpdateItem } from '@commerce/cart/use-update-item' import useCart from './use-cart' import { handler as removeItemHandler } from './use-remove-item' @@ -27,11 +21,7 @@ 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) { @@ -47,11 +37,8 @@ export const handler = { }) } - const checkoutId = getCheckoutId().checkoutId; - const { checkoutLinesUpdate } = await fetch< - Mutation, - MutationCheckoutLinesUpdateArgs - >({ + const checkoutId = getCheckoutId().checkoutId + const { checkoutLinesUpdate } = await fetch({ ...options, variables: { checkoutId, @@ -66,44 +53,42 @@ export const handler = { return checkoutToCart(checkoutLinesUpdate) }, - 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: UpdateItemInput) => { - 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', - }) - } + return useCallback( + debounce(async (input: UpdateItemInput) => { + 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', + }) + } - const data = await fetch({ - input: { - item: { - productId, - variantId, - quantity: input.quantity, + const data = await fetch({ + input: { + item: { + productId, + variantId, + quantity: input.quantity, + }, + itemId, }, - itemId, - }, - }) - 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/framework/saleor/common/get-all-pages.ts b/framework/saleor/common/get-all-pages.ts index 688c9ae5f..69c460a0d 100644 --- a/framework/saleor/common/get-all-pages.ts +++ b/framework/saleor/common/get-all-pages.ts @@ -28,13 +28,11 @@ const getAllPages = async (options?: { const { locale } = config const { data } = await config.fetch(query.PageMany, { variables }) - const pages = data.pages?.edges?.map( - ({ node: { title: name, slug, ...node } }: PageCountableEdge) => ({ - ...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/framework/saleor/const.ts b/framework/saleor/const.ts index 39a8964f9..df348770d 100644 --- a/framework/saleor/const.ts +++ b/framework/saleor/const.ts @@ -3,5 +3,3 @@ export const API_CHANNEL = process.env.NEXT_PUBLIC_SALEOR_CHANNEL export const CHECKOUT_ID_COOKIE = 'saleor.CheckoutID' export const SALEOR_TOKEN = 'saleor.Token' export const SALEOR_CRSF_TOKEN = 'saleor.CSRFToken' - - diff --git a/framework/saleor/customer/get-customer-id.ts b/framework/saleor/customer/get-customer-id.ts index a9d38e8ba..97bde3905 100644 --- a/framework/saleor/customer/get-customer-id.ts +++ b/framework/saleor/customer/get-customer-id.ts @@ -13,8 +13,7 @@ async function getCustomerId({ const { data } = await config.fetch(query.CustomerOne, { variables: { - customerAccesToken: - customerAccesToken || Cookies.get(config.customerCookie), + customerAccesToken: customerAccesToken || Cookies.get(config.customerCookie), }, }) diff --git a/framework/saleor/customer/use-customer.tsx b/framework/saleor/customer/use-customer.tsx index c8140d82b..a84c3d593 100644 --- a/framework/saleor/customer/use-customer.tsx +++ b/framework/saleor/customer/use-customer.tsx @@ -17,12 +17,14 @@ export const handler: SWRHook = { }) return data.me ?? null }, - useHook: ({ useData }) => (input) => { - return useData({ - swrOptions: { - revalidateOnFocus: false, - ...input?.swrOptions, - }, - }) - }, + useHook: + ({ useData }) => + (input) => { + return useData({ + swrOptions: { + revalidateOnFocus: false, + ...input?.swrOptions, + }, + }) + }, } diff --git a/framework/saleor/fetcher.ts b/framework/saleor/fetcher.ts index 642c48291..9d3c0bf89 100644 --- a/framework/saleor/fetcher.ts +++ b/framework/saleor/fetcher.ts @@ -2,13 +2,8 @@ import { Fetcher } from '@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 token = getToken(); +const fetcher: Fetcher = async ({ url = API_URL, method = 'POST', variables, query }) => { + const token = getToken() return handleFetchResponse( await fetch(url!, { diff --git a/framework/saleor/index.tsx b/framework/saleor/index.tsx index f1d72f5a4..5c9e61ec8 100644 --- a/framework/saleor/index.tsx +++ b/framework/saleor/index.tsx @@ -1,21 +1,17 @@ import * as React from 'react' import { ReactNode } from 'react' -import { - CommerceConfig, - CommerceProvider as CoreCommerceProvider, - useCommerce as useCoreCommerce, -} from '@commerce' +import { CommerceConfig, CommerceProvider as CoreCommerceProvider, useCommerce as useCoreCommerce } from '@commerce' import { saleorProvider, SaleorProvider } from './provider' -import * as Const from './const'; +import * as Const from './const' export { saleorProvider } export type { SaleorProvider } export const saleorConfig: CommerceConfig = { locale: 'en-us', - cartCookie: Const.CHECKOUT_ID_COOKIE + cartCookie: Const.CHECKOUT_ID_COOKIE, } export type SaleorConfig = Partial @@ -27,10 +23,7 @@ export type SaleorProps = { export function CommerceProvider({ children, ...config }: SaleorProps) { return ( - + {children} ) diff --git a/framework/saleor/product/get-all-collections.ts b/framework/saleor/product/get-all-collections.ts index 1d6650579..3b1ae9410 100644 --- a/framework/saleor/product/get-all-collections.ts +++ b/framework/saleor/product/get-all-collections.ts @@ -2,24 +2,18 @@ import { CollectionCountableEdge } from '../schema' import { getConfig, SaleorConfig } from '../api' import * as query from '../utils/queries' -const getAllCollections = async (options?: { - variables?: any - config: SaleorConfig - preview?: boolean -}) => { +const getAllCollections = async (options?: { variables?: any; config: SaleorConfig; preview?: boolean }) => { let { config, variables = { first: 100 } } = options ?? {} config = getConfig(config) const { data } = await config.fetch(query.CollectionMany, { variables }) const edges = data.collections?.edges ?? [] - const categories = edges.map( - ({ node: { id: entityId, name, slug } }: CollectionCountableEdge) => ({ - entityId, - name, - path: `/${slug}`, - }) - ) + const categories = edges.map(({ node: { id: entityId, name, slug } }: CollectionCountableEdge) => ({ + entityId, + name, + path: `/${slug}`, + })) return { categories, diff --git a/framework/saleor/product/get-all-products.ts b/framework/saleor/product/get-all-products.ts index 69de2e0d3..2d37f283f 100644 --- a/framework/saleor/product/get-all-products.ts +++ b/framework/saleor/product/get-all-products.ts @@ -24,12 +24,11 @@ const getAllProducts = async (options: { let { config, variables = { first: 100 } } = options ?? {} config = getConfig(config) - const { data }: GraphQLFetcherResult = await config.fetch(query.ProductMany, { variables }) + const { data }: GraphQLFetcherResult = await config.fetch(query.ProductMany, { + variables, + }) - 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/framework/saleor/product/get-product.ts b/framework/saleor/product/get-product.ts index 6e683512a..e45aea19c 100644 --- a/framework/saleor/product/get-product.ts +++ b/framework/saleor/product/get-product.ts @@ -1,7 +1,7 @@ import { GraphQLFetcherResult } from '@commerce/api' import { getConfig, SaleorConfig } from '../api' import { normalizeProduct } from '../utils' -import * as query from '../utils/queries'; +import * as query from '../utils/queries' type Variables = { slug: string diff --git a/framework/saleor/product/use-search.tsx b/framework/saleor/product/use-search.tsx index 40bd096a6..7a1aa1594 100644 --- a/framework/saleor/product/use-search.tsx +++ b/framework/saleor/product/use-search.tsx @@ -3,10 +3,7 @@ import { Product } from '@commerce/types' import useSearch, { UseSearch } from '@commerce/product/use-search' import { ProductCountableEdge } from '../schema' -import { - getSearchVariables, - normalizeProduct, -} from '../utils' +import { getSearchVariables, normalizeProduct } from '../utils' import * as query from '../utils/queries' @@ -24,13 +21,9 @@ export type SearchProductsData = { found: boolean } -export const handler: SWRHook< - SearchProductsData, - SearchProductsInput, - SearchProductsInput -> = { +export const handler: SWRHook = { fetchOptions: { - query: query.ProductMany + query: query.ProductMany, }, async fetcher({ input, options, fetch }) { const { categoryId, brandId } = input @@ -57,24 +50,24 @@ export const handler: SWRHook< } return { - products: edges.map(({ node }: ProductCountableEdge) => - normalizeProduct(node) - ), + products: edges.map(({ node }: ProductCountableEdge) => normalizeProduct(node)), found: !!edges.length, } }, - 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/framework/saleor/provider.ts b/framework/saleor/provider.ts index e18903403..2ca96475a 100644 --- a/framework/saleor/provider.ts +++ b/framework/saleor/provider.ts @@ -14,8 +14,8 @@ import fetcher from './fetcher' export const saleorProvider = { locale: 'en-us', - cartCookie: "", - cartCookieToken: "", + cartCookie: '', + cartCookieToken: '', fetcher, cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, customer: { useCustomer }, diff --git a/framework/saleor/schema.d.ts b/framework/saleor/schema.d.ts index d1df0a113..339e7269d 100644 --- a/framework/saleor/schema.d.ts +++ b/framework/saleor/schema.d.ts @@ -2,10 +2,8 @@ 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 @@ -11442,15 +11440,11 @@ export type GetAllProductPathsQueryVariables = Exact<{ export type GetAllProductPathsQuery = { __typename?: 'Query' } & { products?: Maybe< { __typename?: 'ProductCountableConnection' } & { - pageInfo: { __typename?: 'PageInfo' } & Pick< - PageInfo, - 'hasNextPage' | 'hasPreviousPage' - > + pageInfo: { __typename?: 'PageInfo' } & Pick edges: Array< - { __typename?: 'ProductCountableEdge' } & Pick< - ProductCountableEdge, - 'cursor' - > & { node: { __typename?: 'Product' } & Pick } + { __typename?: 'ProductCountableEdge' } & Pick & { + node: { __typename?: 'Product' } & Pick + } > } > @@ -11459,16 +11453,10 @@ export type GetAllProductPathsQuery = { __typename?: 'Query' } & { export type ProductConnectionFragment = { __typename?: 'ProductCountableConnection' } & { - pageInfo: { __typename?: 'PageInfo' } & Pick< - PageInfo, - 'hasNextPage' | 'hasPreviousPage' - > + pageInfo: { __typename?: 'PageInfo' } & Pick edges: Array< { __typename?: 'ProductCountableEdge' } & { - node: { __typename?: 'Product' } & Pick< - Product, - 'id' | 'name' | 'description' | 'slug' - > & { + node: { __typename?: 'Product' } & Pick & { pricing?: Maybe< { __typename?: 'ProductPricingInfo' } & { priceRange?: Maybe< @@ -11482,14 +11470,7 @@ export type ProductConnectionFragment = { > } > - media?: Maybe< - Array< - { __typename?: 'ProductMedia' } & Pick< - ProductMedia, - 'url' | 'alt' - > - > - > + media?: Maybe>> } } > @@ -11503,7 +11484,5 @@ export type GetAllProductsQueryVariables = Exact<{ }> export type GetAllProductsQuery = { __typename?: 'Query' } & { - products?: Maybe< - { __typename?: 'ProductCountableConnection' } & ProductConnectionFragment - > + products?: Maybe<{ __typename?: 'ProductCountableConnection' } & ProductConnectionFragment> } diff --git a/framework/saleor/schema.graphql b/framework/saleor/schema.graphql index aa5c7c263..de2858641 100644 --- a/framework/saleor/schema.graphql +++ b/framework/saleor/schema.graphql @@ -7,9 +7,7 @@ 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 } @@ -23,9 +21,7 @@ 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 } @@ -39,9 +35,7 @@ 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 } @@ -51,9 +45,7 @@ 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 } @@ -154,9 +146,7 @@ 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 } @@ -198,9 +188,7 @@ 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!]! } @@ -213,9 +201,7 @@ 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!]! } @@ -224,9 +210,7 @@ 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 } @@ -275,9 +259,7 @@ 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 } @@ -291,9 +273,7 @@ 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 } @@ -364,9 +344,7 @@ 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!]! } @@ -387,9 +365,7 @@ 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 } @@ -538,10 +514,7 @@ 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 } @@ -579,10 +552,7 @@ 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 } @@ -591,10 +561,7 @@ 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 } @@ -603,10 +570,7 @@ 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 } @@ -615,10 +579,7 @@ 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 } @@ -669,10 +630,7 @@ 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!]! } @@ -698,10 +656,7 @@ 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 } @@ -765,10 +720,7 @@ 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 } @@ -825,10 +777,7 @@ 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 } @@ -837,10 +786,7 @@ 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 } @@ -865,10 +811,7 @@ 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!]! } @@ -891,10 +834,7 @@ 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 } @@ -919,10 +859,7 @@ 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!]! } @@ -934,18 +871,8 @@ 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. @@ -1042,9 +969,7 @@ 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!]! } @@ -1079,9 +1004,7 @@ 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!]! } @@ -1162,9 +1085,7 @@ 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 } @@ -1264,9 +1185,7 @@ 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!]! } @@ -1357,9 +1276,7 @@ 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 } @@ -1391,9 +1308,7 @@ 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!]! } @@ -1523,9 +1438,7 @@ 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!]! } @@ -1538,9 +1451,7 @@ 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 } @@ -1571,9 +1482,7 @@ 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 } @@ -1638,9 +1547,7 @@ 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 } @@ -1673,9 +1580,7 @@ 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 } @@ -1812,10 +1717,7 @@ 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. @@ -1923,9 +1825,7 @@ 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!]! } @@ -1959,9 +1859,7 @@ 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 } @@ -1971,9 +1869,7 @@ 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 } @@ -2063,10 +1959,7 @@ 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. @@ -2089,9 +1982,7 @@ 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 } @@ -2114,10 +2005,7 @@ 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.") } """ @@ -2125,9 +2013,7 @@ 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 } @@ -2160,9 +2046,7 @@ 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!]! } @@ -2171,9 +2055,7 @@ 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 } @@ -2214,9 +2096,7 @@ 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!]! } @@ -2225,9 +2105,7 @@ 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 } @@ -2282,9 +2160,7 @@ 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 } @@ -2422,9 +2298,7 @@ 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!]! } @@ -2437,9 +2311,7 @@ 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!]! } @@ -2462,9 +2334,7 @@ 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!]! } @@ -2502,9 +2372,7 @@ 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 } @@ -2550,9 +2418,7 @@ 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!]! } @@ -2565,9 +2431,7 @@ 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!]! } @@ -2580,9 +2444,7 @@ 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!]! } @@ -2651,9 +2513,7 @@ 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!]! } @@ -2713,9 +2573,7 @@ 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!]! } @@ -2740,9 +2598,7 @@ 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!]! } @@ -2755,9 +2611,7 @@ 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!]! } @@ -2775,9 +2629,7 @@ 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!]! } @@ -2790,9 +2642,7 @@ 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!]! } @@ -2805,9 +2655,7 @@ 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!]! } @@ -2820,9 +2668,7 @@ 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!]! } @@ -2858,10 +2704,7 @@ 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. @@ -2929,9 +2772,7 @@ 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!]! } @@ -2944,9 +2785,7 @@ 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!]! } @@ -3004,9 +2843,7 @@ 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!]! } @@ -3052,9 +2889,7 @@ 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 } @@ -3111,9 +2946,7 @@ 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 } @@ -3221,9 +3054,7 @@ 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!]! } @@ -3236,9 +3067,7 @@ 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!]! } @@ -3294,10 +3123,7 @@ 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. @@ -3320,9 +3146,7 @@ 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 } @@ -3345,10 +3169,7 @@ 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.") } """ @@ -3356,9 +3177,7 @@ 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 } @@ -3427,9 +3246,7 @@ 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!]! } @@ -3442,9 +3259,7 @@ 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!]! } @@ -3745,9 +3560,7 @@ 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!]! } @@ -3787,9 +3600,7 @@ 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!]! } @@ -3798,9 +3609,7 @@ 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 } @@ -3810,9 +3619,7 @@ 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 } @@ -3935,9 +3742,7 @@ 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 } @@ -3985,9 +3790,7 @@ 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!]! } @@ -3996,9 +3799,7 @@ 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 } @@ -4008,9 +3809,7 @@ 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 } @@ -4080,9 +3879,7 @@ 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!]! } @@ -4092,9 +3889,7 @@ 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!]! } @@ -4127,9 +3922,7 @@ 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!]! } @@ -4186,9 +3979,7 @@ 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 } @@ -4292,10 +4083,7 @@ 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!]! } @@ -4307,10 +4095,7 @@ 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!]! } @@ -4318,10 +4103,7 @@ 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 } @@ -4383,10 +4165,7 @@ 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 } @@ -4447,10 +4226,7 @@ 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!]! } @@ -4458,10 +4234,7 @@ 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 } @@ -4674,9 +4447,7 @@ 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!]! } @@ -4745,9 +4516,7 @@ 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!]! } @@ -4760,9 +4529,7 @@ 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!]! } @@ -4790,9 +4557,7 @@ 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!]! } @@ -4820,9 +4585,7 @@ 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!]! } @@ -4845,9 +4608,7 @@ 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!]! } @@ -4877,9 +4638,7 @@ 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!]! } @@ -4935,10 +4694,7 @@ 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!]! } @@ -4974,10 +4730,7 @@ 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!]! } @@ -5004,10 +4757,7 @@ 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!]! } @@ -5059,10 +4809,7 @@ 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!]! } @@ -5141,9 +4888,7 @@ 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!]! } @@ -5177,9 +4922,7 @@ 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 } @@ -5220,9 +4963,7 @@ 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!]! } @@ -5260,9 +5001,7 @@ 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 } @@ -5419,9 +5158,7 @@ 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 } @@ -5443,9 +5180,7 @@ 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 } @@ -5489,9 +5224,7 @@ 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 } @@ -5501,9 +5234,7 @@ 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 } @@ -5513,9 +5244,7 @@ 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 } @@ -5525,9 +5254,7 @@ 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 } @@ -5749,10 +5476,7 @@ 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!]! } @@ -5785,10 +5509,7 @@ 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 } @@ -5814,10 +5535,7 @@ 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 } @@ -5923,10 +5641,7 @@ 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!]! } @@ -5959,10 +5674,7 @@ 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 } @@ -6008,10 +5720,7 @@ 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 } @@ -6056,10 +5765,7 @@ 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!]! } @@ -6120,9 +5826,7 @@ 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 } @@ -6144,10 +5848,7 @@ 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 } @@ -6187,10 +5888,7 @@ 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 } @@ -9827,26 +9525,17 @@ 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. @@ -9889,10 +9578,7 @@ 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!]! } @@ -9911,10 +9597,7 @@ 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!]! } @@ -9926,10 +9609,7 @@ 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!]! } @@ -9941,10 +9621,7 @@ 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!]! } @@ -9953,10 +9630,7 @@ 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!]! } @@ -10038,10 +9712,7 @@ 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!]! } @@ -10070,10 +9741,7 @@ 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!]! } @@ -10100,10 +9768,7 @@ 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!]! } @@ -10469,10 +10134,7 @@ 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!]! } @@ -10616,10 +10278,7 @@ 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!]! } @@ -10636,10 +10295,7 @@ 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!]! } @@ -10656,10 +10312,7 @@ 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!]! } @@ -10678,10 +10331,7 @@ 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 } @@ -10699,10 +10349,7 @@ 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!]! } @@ -10714,10 +10361,7 @@ 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!]! } @@ -10738,10 +10382,7 @@ 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!]! } @@ -10892,9 +10533,7 @@ 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!]! } @@ -11003,10 +10642,7 @@ 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 } @@ -11036,10 +10672,7 @@ 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!]! } @@ -11058,10 +10691,7 @@ 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!]! } @@ -11096,10 +10726,7 @@ 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. @@ -11125,10 +10752,7 @@ 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!]! } @@ -11140,10 +10764,7 @@ 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!]! } @@ -11155,10 +10776,7 @@ 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!]! } @@ -11170,10 +10788,7 @@ 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!]! } @@ -11206,10 +10821,7 @@ 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 } @@ -11260,10 +10872,7 @@ 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 } @@ -11384,10 +10993,7 @@ 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!]! } @@ -11443,10 +11049,7 @@ 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. @@ -11469,9 +11072,7 @@ 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 } @@ -11494,10 +11095,7 @@ 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 { @@ -11574,10 +11172,7 @@ 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!]! } @@ -11610,10 +11205,7 @@ 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 } @@ -11639,10 +11231,7 @@ 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 } @@ -11659,10 +11248,7 @@ 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!]! } @@ -11694,10 +11280,7 @@ 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 } @@ -11728,10 +11311,7 @@ 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 } @@ -11745,9 +11325,7 @@ 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!]! } @@ -11819,9 +11397,7 @@ 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!]! } @@ -11935,9 +11511,7 @@ 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!]! } @@ -11992,9 +11566,7 @@ 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!]! } @@ -12022,9 +11594,7 @@ 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!]! } @@ -12071,9 +11641,7 @@ 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 } @@ -12100,9 +11668,7 @@ 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 } @@ -12176,9 +11742,7 @@ 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 } @@ -12353,9 +11917,7 @@ 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!]! } @@ -12432,10 +11994,7 @@ 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. @@ -12500,10 +12059,7 @@ 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. @@ -12518,10 +12074,7 @@ 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. @@ -12558,9 +12111,7 @@ 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!]! } @@ -12590,9 +12141,7 @@ 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!]! } @@ -12605,9 +12154,7 @@ 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!]! } @@ -12744,9 +12291,7 @@ 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!]! } @@ -12792,9 +12337,7 @@ 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 } @@ -12866,9 +12409,7 @@ 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 } @@ -13078,9 +12619,7 @@ 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!]! } @@ -13091,9 +12630,7 @@ 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!]! } @@ -13126,9 +12663,7 @@ 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!]! } @@ -13139,9 +12674,7 @@ 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!]! } @@ -13167,9 +12700,7 @@ 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!]! } @@ -13299,9 +12830,7 @@ 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!]! } @@ -13323,10 +12852,7 @@ 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. @@ -13349,9 +12875,7 @@ 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 } @@ -13374,10 +12898,7 @@ 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.") } """ @@ -13491,9 +13012,7 @@ 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!]! } @@ -13532,9 +13051,7 @@ 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 } @@ -13544,9 +13061,7 @@ 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 } @@ -13620,9 +13135,7 @@ 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!]! } @@ -13660,9 +13173,7 @@ 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 } @@ -13672,9 +13183,7 @@ 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 } @@ -13751,10 +13260,7 @@ 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. @@ -13821,9 +13327,7 @@ 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!]! } @@ -13868,9 +13372,7 @@ 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!]! } @@ -13922,9 +13424,7 @@ 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!]! } @@ -13958,9 +13458,7 @@ 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 } @@ -14002,9 +13500,7 @@ 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 } @@ -14043,9 +13539,7 @@ 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!]! } @@ -14058,9 +13552,7 @@ 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!]! } @@ -14070,9 +13562,7 @@ 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!]! } @@ -14085,9 +13575,7 @@ 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!]! } @@ -14099,10 +13587,7 @@ 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!]! } @@ -14115,9 +13600,7 @@ 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!]! } @@ -14149,9 +13632,7 @@ 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 } @@ -14174,9 +13655,7 @@ 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 } @@ -15782,9 +15261,7 @@ 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!]! } @@ -15814,9 +15291,7 @@ 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!]! } @@ -15825,9 +15300,7 @@ 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!]! } @@ -15954,9 +15427,7 @@ 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!]! } @@ -15969,9 +15440,7 @@ 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!]! } @@ -16021,9 +15490,7 @@ 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!]! } @@ -16057,9 +15524,7 @@ 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 } @@ -16069,9 +15534,7 @@ 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 } @@ -16134,9 +15597,7 @@ 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!]! } @@ -16212,9 +15673,7 @@ 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 } @@ -16252,9 +15711,7 @@ 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 } @@ -16310,9 +15767,7 @@ 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!]! } @@ -16505,9 +15960,7 @@ 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!]! } @@ -16603,9 +16056,7 @@ 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!]! } @@ -16619,9 +16070,7 @@ 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!]! } @@ -16639,9 +16088,7 @@ 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!]! } @@ -16654,9 +16101,7 @@ 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!]! } @@ -16733,9 +16178,7 @@ 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!]! } @@ -16744,9 +16187,7 @@ 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 } @@ -16770,9 +16211,7 @@ 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!]! } @@ -16837,9 +16276,7 @@ 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!]! } @@ -16873,9 +16310,7 @@ 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 } @@ -16917,9 +16352,7 @@ 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 } @@ -16934,9 +16367,7 @@ 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 } @@ -17166,10 +16597,7 @@ 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!]! } @@ -17181,10 +16609,7 @@ 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!]! } @@ -17226,10 +16651,7 @@ 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!]! } @@ -17309,9 +16731,7 @@ 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!]! } @@ -17328,10 +16748,7 @@ 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!]! } @@ -17369,10 +16786,7 @@ 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!]! } @@ -17380,10 +16794,7 @@ 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 } @@ -17429,10 +16840,7 @@ 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 } @@ -17515,10 +16923,7 @@ 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 } @@ -17527,10 +16932,7 @@ 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 } @@ -17556,10 +16958,7 @@ 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 } @@ -17568,10 +16967,7 @@ 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 } @@ -17984,9 +17380,7 @@ 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 } @@ -17996,9 +17390,7 @@ 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 } @@ -18074,9 +17466,7 @@ 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. @@ -18189,9 +17579,7 @@ 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!]! } @@ -18204,9 +17592,7 @@ 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!]! } @@ -18219,9 +17605,7 @@ 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!]! } @@ -18391,9 +17775,7 @@ 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!]! } @@ -18404,9 +17786,7 @@ 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!]! } @@ -18464,9 +17844,7 @@ 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!]! } @@ -18637,9 +18015,7 @@ 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!]! } @@ -18652,9 +18028,7 @@ 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!]! } @@ -18710,9 +18084,7 @@ 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!]! } @@ -18746,9 +18118,7 @@ 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 } @@ -18758,9 +18128,7 @@ 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 } @@ -18860,9 +18228,7 @@ 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!]! } @@ -18948,9 +18314,7 @@ 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 } @@ -18979,9 +18343,7 @@ 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 } @@ -18997,12 +18359,7 @@ 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! @@ -19089,9 +18446,7 @@ 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 } @@ -19133,9 +18488,7 @@ 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 } @@ -19179,9 +18532,7 @@ 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 } @@ -19191,9 +18542,7 @@ 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 } @@ -19222,9 +18571,7 @@ 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 } @@ -19282,9 +18629,7 @@ 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 } @@ -19326,9 +18671,7 @@ 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 } @@ -19541,9 +18884,7 @@ 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/framework/saleor/utils/checkout-attach.ts b/framework/saleor/utils/checkout-attach.ts index af9711ddd..476c73e77 100644 --- a/framework/saleor/utils/checkout-attach.ts +++ b/framework/saleor/utils/checkout-attach.ts @@ -1,16 +1,12 @@ import * as mutation from './mutations' import { CheckoutCustomerAttach } from '../schema' -export const checkoutAttach = async ( - fetch: any, - { variables, headers }: any, -): Promise => { - const data = await fetch({ +export const checkoutAttach = async (fetch: any, { variables, headers }: any): Promise => { + const data = await fetch({ query: mutation.CheckoutAttach, - variables, - headers + variables, + headers, }) - return data; + return data } - diff --git a/framework/saleor/utils/checkout-create.ts b/framework/saleor/utils/checkout-create.ts index fe1c15daa..c1b6e4023 100644 --- a/framework/saleor/utils/checkout-create.ts +++ b/framework/saleor/utils/checkout-create.ts @@ -4,15 +4,13 @@ import * as mutation from './mutations' import { CheckoutCreate } from '../schema' import { CHECKOUT_ID_COOKIE } from '@framework/const' -export const checkoutCreate = async ( - fetch: any -): Promise => { +export const checkoutCreate = async (fetch: any): Promise => { const data = await fetch({ query: mutation.CheckoutCreate }) const checkout = data.checkoutCreate?.checkout const checkoutId = checkout?.id - const checkoutToken = checkout?.token + const checkoutToken = checkout?.token - const value = `${checkoutId}:${checkoutToken}`; + const value = `${checkoutId}:${checkoutToken}` if (checkoutId) { const options = { diff --git a/framework/saleor/utils/checkout-to-cart.ts b/framework/saleor/utils/checkout-to-cart.ts index f55787c51..917fa8d0b 100644 --- a/framework/saleor/utils/checkout-to-cart.ts +++ b/framework/saleor/utils/checkout-to-cart.ts @@ -1,14 +1,7 @@ import { Cart } from '../types' import { CommerceError } from '@commerce/utils/errors' -import { - CheckoutLinesAdd, - CheckoutLinesUpdate, - CheckoutCreate, - CheckoutError, - Checkout, - Maybe, -} from '../schema' +import { CheckoutLinesAdd, CheckoutLinesUpdate, CheckoutCreate, CheckoutError, Checkout, Maybe } from '../schema' import { normalizeCart } from './normalize' import throwUserErrors from './throw-user-errors' @@ -18,11 +11,7 @@ export type CheckoutQuery = { errors?: Array } -export type CheckoutPayload = - | CheckoutLinesAdd - | CheckoutLinesUpdate - | CheckoutCreate - | CheckoutQuery +export type CheckoutPayload = CheckoutLinesAdd | CheckoutLinesUpdate | CheckoutCreate | CheckoutQuery const checkoutToCart = (checkoutPayload?: Maybe): Cart => { if (!checkoutPayload) { diff --git a/framework/saleor/utils/customer-token.ts b/framework/saleor/utils/customer-token.ts index 702bffd04..dd15fbe25 100644 --- a/framework/saleor/utils/customer-token.ts +++ b/framework/saleor/utils/customer-token.ts @@ -1,5 +1,5 @@ import Cookies, { CookieAttributes } from 'js-cookie' -import * as Const from '../const'; +import * as Const from '../const' export const getToken = () => Cookies.get(Const.SALEOR_TOKEN) export const setToken = (token?: string, options?: CookieAttributes) => { diff --git a/framework/saleor/utils/fragments/checkout-details.ts b/framework/saleor/utils/fragments/checkout-details.ts index bf9370b06..1a5c44295 100644 --- a/framework/saleor/utils/fragments/checkout-details.ts +++ b/framework/saleor/utils/fragments/checkout-details.ts @@ -45,4 +45,4 @@ export const CheckoutDetails = ` } } } -` \ No newline at end of file +` diff --git a/framework/saleor/utils/fragments/index.ts b/framework/saleor/utils/fragments/index.ts index 8abf6d39e..6c0c88950 100644 --- a/framework/saleor/utils/fragments/index.ts +++ b/framework/saleor/utils/fragments/index.ts @@ -1,2 +1,2 @@ -export { ProductConnection } from './product'; -export { CheckoutDetails } from './checkout-details'; \ No newline at end of file +export { ProductConnection } from './product' +export { CheckoutDetails } from './checkout-details' diff --git a/framework/saleor/utils/fragments/product.ts b/framework/saleor/utils/fragments/product.ts index 69ad0a6e0..1ea59c02d 100644 --- a/framework/saleor/utils/fragments/product.ts +++ b/framework/saleor/utils/fragments/product.ts @@ -1,4 +1,4 @@ -export const ProductConnection = /* GraphQL */ ` +export const ProductConnection = /* GraphQL */ ` fragment ProductConnection on ProductCountableConnection { pageInfo { hasNextPage @@ -26,4 +26,4 @@ export const ProductConnection = /* GraphQL */ ` } } } -` \ No newline at end of file +` diff --git a/framework/saleor/utils/get-categories.ts b/framework/saleor/utils/get-categories.ts index e7394f287..04402c2ae 100644 --- a/framework/saleor/utils/get-categories.ts +++ b/framework/saleor/utils/get-categories.ts @@ -1,6 +1,6 @@ import { SaleorConfig } from '../api' import { CollectionCountableEdge } from '../schema' -import * as query from './queries'; +import * as query from './queries' export type Category = { entityId: string @@ -16,13 +16,11 @@ const getCategories = async (config: SaleorConfig): Promise => { }) return ( - data.collections?.edges?.map( - ({ node: { id: entityId, name, slug } }: CollectionCountableEdge) => ({ - entityId, - name, - path: `/${slug}`, - }) - ) ?? [] + data.collections?.edges?.map(({ node: { id: entityId, name, slug } }: CollectionCountableEdge) => ({ + entityId, + name, + path: `/${slug}`, + })) ?? [] ) } diff --git a/framework/saleor/utils/get-checkout-id.ts b/framework/saleor/utils/get-checkout-id.ts index 1d1b6f448..de495a9ad 100644 --- a/framework/saleor/utils/get-checkout-id.ts +++ b/framework/saleor/utils/get-checkout-id.ts @@ -2,7 +2,7 @@ import Cookies from 'js-cookie' import { CHECKOUT_ID_COOKIE } from '../const' const getCheckoutId = (id?: string) => { - const r = Cookies.get(CHECKOUT_ID_COOKIE)?.split(":") || []; + const r = Cookies.get(CHECKOUT_ID_COOKIE)?.split(':') || [] return { checkoutId: r[0], checkoutToken: r[1] } } diff --git a/framework/saleor/utils/get-search-variables.ts b/framework/saleor/utils/get-search-variables.ts index ff40a654b..5adf938e8 100644 --- a/framework/saleor/utils/get-search-variables.ts +++ b/framework/saleor/utils/get-search-variables.ts @@ -1,17 +1,17 @@ import { getSortVariables } from './get-sort-variables' import type { SearchProductsInput } from '../product/use-search' -export const getSearchVariables = ({ - brandId, - search, - categoryId, - sort, -}: SearchProductsInput) => { - const sortBy = { field: "NAME", direction: 'ASC', ...getSortVariables(sort, !!categoryId), channel: "default-channel"}; +export const getSearchVariables = ({ brandId, search, categoryId, sort }: SearchProductsInput) => { + const sortBy = { + field: 'NAME', + direction: 'ASC', + ...getSortVariables(sort, !!categoryId), + channel: 'default-channel', + } return { categoryId, filter: { search }, - sortBy + sortBy, } } diff --git a/framework/saleor/utils/get-sort-variables.ts b/framework/saleor/utils/get-sort-variables.ts index e29437f42..fe040a0a5 100644 --- a/framework/saleor/utils/get-sort-variables.ts +++ b/framework/saleor/utils/get-sort-variables.ts @@ -4,7 +4,7 @@ export const getSortVariables = (sort?: string, isCategory: boolean = false) => case 'price-asc': output = { field: 'PRICE', - direction: 'ASC' + direction: 'ASC', } break case 'price-desc': @@ -22,10 +22,9 @@ export const getSortVariables = (sort?: string, isCategory: boolean = false) => case 'latest-desc': output = { field: 'DATE', - direction: 'DESC' + direction: 'DESC', } break } return output } - diff --git a/framework/saleor/utils/handle-login.ts b/framework/saleor/utils/handle-login.ts index d5f214ed1..4ef390174 100644 --- a/framework/saleor/utils/handle-login.ts +++ b/framework/saleor/utils/handle-login.ts @@ -14,18 +14,15 @@ const handleLogin = (data: CreateToken) => { setCSRFToken(token) } - return token + return token } export const handleAutomaticLogin = async ( fetch: (options: FetcherOptions) => Promise, - input: MutationTokenCreateArgs + input: MutationTokenCreateArgs ) => { try { - const { tokenCreate } = await fetch< - Mutation, - MutationTokenCreateArgs - >({ + const { tokenCreate } = await fetch({ query: mutation.SessionCreate, variables: { ...input }, }) diff --git a/framework/saleor/utils/index.ts b/framework/saleor/utils/index.ts index b84d3ed8a..de81eea67 100644 --- a/framework/saleor/utils/index.ts +++ b/framework/saleor/utils/index.ts @@ -7,7 +7,7 @@ export { default as getCategories } from './get-categories' export { default as getCheckoutId } from './get-checkout-id' export { default as checkoutCreate } from './checkout-create' -export { checkoutAttach } from './checkout-attach'; +export { checkoutAttach } from './checkout-attach' export { default as checkoutToCart } from './checkout-to-cart' export { default as handleLogin, handleAutomaticLogin } from './handle-login' diff --git a/framework/saleor/utils/mutations/checkout-line-update.ts b/framework/saleor/utils/mutations/checkout-line-update.ts index e40c790c9..0cb351dcc 100644 --- a/framework/saleor/utils/mutations/checkout-line-update.ts +++ b/framework/saleor/utils/mutations/checkout-line-update.ts @@ -1,4 +1,4 @@ -import * as fragment from '../fragments'; +import * as fragment from '../fragments' export const CheckoutLineUpdate = /* GraphQL */ ` mutation CheckoutLineUpdate($checkoutId: ID!, $lineItems: [CheckoutLineInput!]!) { diff --git a/framework/saleor/utils/normalize.ts b/framework/saleor/utils/normalize.ts index 814467c83..b142e8f04 100644 --- a/framework/saleor/utils/normalize.ts +++ b/framework/saleor/utils/normalize.ts @@ -1,12 +1,6 @@ import { Product } from '@commerce/types' -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' @@ -25,9 +19,7 @@ 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 ? { @@ -72,36 +64,20 @@ 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)) || - 0, + price: (pricing?.priceRange?.start?.net && money(pricing.priceRange.start.net)) || 0, // 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) : [], - options: - variants && variants.length > 0 ? normalizeProductOptions(variants) : [], + variants: variants && variants.length > 0 ? normalizeProductVariants(variants) : [], + options: variants && variants.length > 0 ? normalizeProductOptions(variants) : [], ...rest, } @@ -109,8 +85,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 lines = checkout.lines as CheckoutLine[] + const lineItems: LineItem[] = lines.length > 0 ? lines?.map(normalizeLineItem) : [] return { id: checkout.id, @@ -118,12 +94,12 @@ export function normalizeCart(checkout: Checkout): Cart { email: '', createdAt: checkout.created, currency: { - code: checkout.totalPrice?.currency! + code: checkout.totalPrice?.currency!, }, taxesIncluded: false, - lineItems, - lineItemsSubtotalPrice: checkout.subtotalPrice?.gross?.amount!, - subtotalPrice: checkout.subtotalPrice?.gross?.amount!, + lineItems, + lineItemsSubtotalPrice: checkout.subtotalPrice?.gross?.amount!, + subtotalPrice: checkout.subtotalPrice?.gross?.amount!, totalPrice: checkout.totalPrice?.gross.amount!, discounts: [], } @@ -145,10 +121,10 @@ function normalizeLineItem({ id, variant, quantity }: CheckoutLine): LineItem { }, requiresShipping: false, price: variant?.pricing?.price?.gross.amount!, - listPrice: 0 + listPrice: 0, }, path: String(variant?.product?.slug), discounts: [], - options: [ ], + options: [], } } diff --git a/framework/saleor/utils/queries/checkout-one.ts b/framework/saleor/utils/queries/checkout-one.ts index 14f6a9aae..0415c1875 100644 --- a/framework/saleor/utils/queries/checkout-one.ts +++ b/framework/saleor/utils/queries/checkout-one.ts @@ -1,4 +1,4 @@ -import * as fragment from '../fragments'; +import * as fragment from '../fragments' export const CheckoutOne = /* GraphQL */ ` query CheckoutOne($checkoutId: UUID!) { diff --git a/framework/saleor/utils/queries/collection-one.ts b/framework/saleor/utils/queries/collection-one.ts index 5771a5aaf..c2e593f51 100644 --- a/framework/saleor/utils/queries/collection-one.ts +++ b/framework/saleor/utils/queries/collection-one.ts @@ -1,11 +1,7 @@ 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/framework/saleor/utils/queries/get-all-product-vendors-query.ts b/framework/saleor/utils/queries/get-all-product-vendors-query.ts index d24dab42d..7d0f01614 100644 --- a/framework/saleor/utils/queries/get-all-product-vendors-query.ts +++ b/framework/saleor/utils/queries/get-all-product-vendors-query.ts @@ -13,4 +13,4 @@ export const getAllProductVendors = /* GraphQL */ ` } } } -` \ No newline at end of file +` diff --git a/framework/saleor/utils/queries/get-all-products-paths-query.ts b/framework/saleor/utils/queries/get-all-products-paths-query.ts index 0933977c5..d9acb82cf 100644 --- a/framework/saleor/utils/queries/get-all-products-paths-query.ts +++ b/framework/saleor/utils/queries/get-all-products-paths-query.ts @@ -1,9 +1,5 @@ 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/framework/saleor/utils/queries/page-many.ts b/framework/saleor/utils/queries/page-many.ts index 7ff0df9b7..94bba696d 100644 --- a/framework/saleor/utils/queries/page-many.ts +++ b/framework/saleor/utils/queries/page-many.ts @@ -10,4 +10,4 @@ export const PageMany = /* GraphQL */ ` } } } -` \ No newline at end of file +` diff --git a/framework/saleor/utils/queries/product-many.ts b/framework/saleor/utils/queries/product-many.ts index 2cf416418..7e0aa9a07 100644 --- a/framework/saleor/utils/queries/product-many.ts +++ b/framework/saleor/utils/queries/product-many.ts @@ -1,4 +1,4 @@ -import * as fragment from '../fragments'; +import * as fragment from '../fragments' export const ProductMany = /* GraphQL */ ` query ProductMany( diff --git a/framework/saleor/utils/queries/product-one-by-slug.ts b/framework/saleor/utils/queries/product-one-by-slug.ts index fb3c94ffc..d1880c49b 100644 --- a/framework/saleor/utils/queries/product-one-by-slug.ts +++ b/framework/saleor/utils/queries/product-one-by-slug.ts @@ -41,4 +41,3 @@ export const ProductOneBySlug = /* GraphQL */ ` } } ` - diff --git a/framework/saleor/utils/throw-user-errors.ts b/framework/saleor/utils/throw-user-errors.ts index d0b8a3291..2991d78a6 100644 --- a/framework/saleor/utils/throw-user-errors.ts +++ b/framework/saleor/utils/throw-user-errors.ts @@ -2,20 +2,16 @@ import { ValidationError } from '@commerce/utils/errors' import { CheckoutError, CheckoutErrorCode, AppError, AccountError, AccountErrorCode } from '../schema' -export type UserErrors = Array +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) { throw new ValidationError({ errors: errors.map(({ code, message }) => ({ code: code ?? 'validation_error', - message: message || "", + message: message || '', })), }) } diff --git a/pages/search.tsx b/pages/search.tsx index d8a502c11..c2121c0da 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -48,7 +48,10 @@ export async function getStaticProps({ } } -export default function Search({ categories, brands }: InferGetStaticPropsType) { +export default function Search({ + categories, + brands, +}: InferGetStaticPropsType) { const [activeFilter, setActiveFilter] = useState('') const [toggleFilter, setToggleFilter] = useState(false)