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 { GraphQLFetcherResult } from '@commerce/api'
|
||||||
import { getConfig, ReactionCommerceConfig } from '../api'
|
import { getConfig, ReactionCommerceConfig } from '../api'
|
||||||
import { CatalogItemEdge } from '../schema'
|
import { CatalogItemEdge } from '../schema'
|
||||||
import { catalogItemsQuery } from '../utils/queries'
|
import { catalogItemsQuery, normalizeProduct } from '../utils'
|
||||||
import { normalizeProduct } from '../utils/normalize'
|
|
||||||
import { Product } from '@commerce/types'
|
import { Product } from '@commerce/types'
|
||||||
|
|
||||||
type Variables = {
|
type Variables = {
|
||||||
|
@ -2,7 +2,7 @@ import {
|
|||||||
cartPayloadFragment,
|
cartPayloadFragment,
|
||||||
incorrectPriceFailureDetailsFragment,
|
incorrectPriceFailureDetailsFragment,
|
||||||
minOrderQuantityFailureDetailsFragment,
|
minOrderQuantityFailureDetailsFragment,
|
||||||
} from '@framework/utils/queries/get-checkout-query'
|
} from '@framework/utils/queries/get-cart-query'
|
||||||
|
|
||||||
const addCartItemsMutation = `
|
const addCartItemsMutation = `
|
||||||
mutation addCartItemsMutation($input: AddCartItemsInput!) {
|
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,
|
cartPayloadFragment,
|
||||||
incorrectPriceFailureDetailsFragment,
|
incorrectPriceFailureDetailsFragment,
|
||||||
minOrderQuantityFailureDetailsFragment,
|
minOrderQuantityFailureDetailsFragment,
|
||||||
} from '@framework/utils/queries/get-checkout-query'
|
} from '@framework/utils/queries/get-cart-query'
|
||||||
|
|
||||||
const createCartMutation = /* GraphQL */ `
|
const createCartMutation = /* GraphQL */ `
|
||||||
mutation createCartMutation($input: CreateCartInput!) {
|
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 = `
|
const reconcileCartsMutation = `
|
||||||
mutation reconcileCartsMutation($input: ReconcileCartsInput!) {
|
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 = `
|
const updateCartItemsQuantityMutation = `
|
||||||
mutation removeCartItemsMutation($input: RemoveCartItemsInput!) {
|
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 = `
|
const updateCartItemsQuantityMutation = `
|
||||||
mutation UpdateCartItemsQuantity($updateCartItemsQuantityInput: UpdateCartItemsQuantityInput!) {
|
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 = `
|
const accountCartByAccountIdQuery = `
|
||||||
query accountCartByAccountIdQuery($accountId: ID!, $shopId: ID!, $itemsAfterCursor: ConnectionCursor) {
|
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 = `
|
export const getAnomymousCart = `
|
||||||
query anonymousCartByCartIdQuery($cartId: ID!, $cartToken: String!, $itemsAfterCursor: ConnectionCursor) {
|
query anonymousCartByCartIdQuery($cartId: ID!, $cartToken: String!, $itemsAfterCursor: ConnectionCursor) {
|
||||||
|
@ -221,7 +221,7 @@ export const minOrderQuantityFailureDetailsFragment = `
|
|||||||
quantity
|
quantity
|
||||||
`
|
`
|
||||||
|
|
||||||
const getCheckoutQuery = /* GraphQL */ `
|
const getCartQuery = /* GraphQL */ `
|
||||||
query($checkoutId: ID!) {
|
query($checkoutId: ID!) {
|
||||||
node(id: $checkoutId) {
|
node(id: $checkoutId) {
|
||||||
... on Checkout {
|
... 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 getAllProductsPathtsQuery } from './get-all-products-paths-query'
|
||||||
export { default as getAllProductVendors } from './get-all-product-vendors-query'
|
export { default as getAllProductVendors } from './get-all-product-vendors-query'
|
||||||
export { default as getCollectionProductsQuery } from './get-collection-products-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 getAllPagesQuery } from './get-all-pages-query'
|
||||||
export { default as getPageQuery } from './get-page-query'
|
export { default as getPageQuery } from './get-page-query'
|
||||||
export { default as viewerQuery } from './viewer-query'
|
export { default as viewerQuery } from './viewer-query'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user