mirror of
https://github.com/vercel/commerce.git
synced 2025-05-19 07:56:59 +00:00
overall clean up
Signed-off-by: Loan Laux <loan@outgrow.io>
This commit is contained in:
parent
ffe33d6453
commit
4ac8ea2df7
@ -1,8 +1,7 @@
|
||||
import { GraphQLFetcherResult } from '@commerce/api'
|
||||
import { getConfig, ReactionCommerceConfig } from '../api'
|
||||
import { CatalogItemEdge } from '../schema'
|
||||
import { catalogItemsQuery } from '../utils/queries'
|
||||
import { normalizeProduct } from '../utils/normalize'
|
||||
import { catalogItemsQuery, normalizeProduct } from '../utils'
|
||||
import { Product } from '@commerce/types'
|
||||
|
||||
type Variables = {
|
||||
|
@ -2,7 +2,7 @@ import {
|
||||
cartPayloadFragment,
|
||||
incorrectPriceFailureDetailsFragment,
|
||||
minOrderQuantityFailureDetailsFragment,
|
||||
} from '@framework/utils/queries/get-checkout-query'
|
||||
} from '@framework/utils/queries/get-cart-query'
|
||||
|
||||
const addCartItemsMutation = `
|
||||
mutation addCartItemsMutation($input: AddCartItemsInput!) {
|
||||
|
@ -1,18 +0,0 @@
|
||||
const associateCustomerWithCheckoutMutation = /* GraphQl */ `
|
||||
mutation associateCustomerWithCheckout($checkoutId: ID!, $customerAccessToken: String!) {
|
||||
checkoutCustomerAssociateV2(checkoutId: $checkoutId, customerAccessToken: $customerAccessToken) {
|
||||
checkout {
|
||||
id
|
||||
}
|
||||
checkoutUserErrors {
|
||||
code
|
||||
field
|
||||
message
|
||||
}
|
||||
customer {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
export default associateCustomerWithCheckoutMutation
|
@ -2,7 +2,7 @@ import {
|
||||
cartPayloadFragment,
|
||||
incorrectPriceFailureDetailsFragment,
|
||||
minOrderQuantityFailureDetailsFragment,
|
||||
} from '@framework/utils/queries/get-checkout-query'
|
||||
} from '@framework/utils/queries/get-cart-query'
|
||||
|
||||
const createCartMutation = /* GraphQL */ `
|
||||
mutation createCartMutation($input: CreateCartInput!) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { cartPayloadFragment } from '@framework/utils/queries/get-checkout-query'
|
||||
import { cartPayloadFragment } from '@framework/utils/queries/get-cart-query'
|
||||
|
||||
const reconcileCartsMutation = `
|
||||
mutation reconcileCartsMutation($input: ReconcileCartsInput!) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { cartPayloadFragment } from '@framework/utils/queries/get-checkout-query'
|
||||
import { cartPayloadFragment } from '@framework/utils/queries/get-cart-query'
|
||||
|
||||
const updateCartItemsQuantityMutation = `
|
||||
mutation removeCartItemsMutation($input: RemoveCartItemsInput!) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { cartPayloadFragment } from '@framework/utils/queries/get-checkout-query'
|
||||
import { cartPayloadFragment } from '@framework/utils/queries/get-cart-query'
|
||||
|
||||
const updateCartItemsQuantityMutation = `
|
||||
mutation UpdateCartItemsQuantity($updateCartItemsQuantityInput: UpdateCartItemsQuantityInput!) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { cartQueryFragment } from '@framework/utils/queries/get-checkout-query'
|
||||
import { cartQueryFragment } from '@framework/utils/queries/get-cart-query'
|
||||
|
||||
const accountCartByAccountIdQuery = `
|
||||
query accountCartByAccountIdQuery($accountId: ID!, $shopId: ID!, $itemsAfterCursor: ConnectionCursor) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { cartQueryFragment } from '../queries/get-checkout-query'
|
||||
import { cartQueryFragment } from './get-cart-query'
|
||||
|
||||
export const getAnomymousCart = `
|
||||
query anonymousCartByCartIdQuery($cartId: ID!, $cartToken: String!, $itemsAfterCursor: ConnectionCursor) {
|
||||
|
@ -221,7 +221,7 @@ export const minOrderQuantityFailureDetailsFragment = `
|
||||
quantity
|
||||
`
|
||||
|
||||
const getCheckoutQuery = /* GraphQL */ `
|
||||
const getCartQuery = /* GraphQL */ `
|
||||
query($checkoutId: ID!) {
|
||||
node(id: $checkoutId) {
|
||||
... on Checkout {
|
||||
@ -238,4 +238,4 @@ export const cartQueryFragment = `
|
||||
}
|
||||
`
|
||||
|
||||
export default getCheckoutQuery
|
||||
export default getCartQuery
|
@ -4,7 +4,7 @@ export { default as catalogItemsQuery } from './catalog-items-query'
|
||||
export { default as getAllProductsPathtsQuery } from './get-all-products-paths-query'
|
||||
export { default as getAllProductVendors } from './get-all-product-vendors-query'
|
||||
export { default as getCollectionProductsQuery } from './get-collection-products-query'
|
||||
export { default as getCheckoutQuery } from './get-checkout-query'
|
||||
export { default as getCartQuery } from './get-cart-query'
|
||||
export { default as getAllPagesQuery } from './get-all-pages-query'
|
||||
export { default as getPageQuery } from './get-page-query'
|
||||
export { default as viewerQuery } from './viewer-query'
|
||||
|
Loading…
x
Reference in New Issue
Block a user