mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 23:46:58 +00:00
fix: merge conflicts
This commit is contained in:
commit
a0f4ab6ac8
@ -18,7 +18,8 @@ if (!API_URL) {
|
||||
|
||||
import fetchGraphqlApi from './utils/fetch-graphql-api'
|
||||
|
||||
export interface ReactionCommerceConfig extends Partial<CommerceAPIConfig> {
|
||||
export interface ReactionCommerceConfig
|
||||
extends Omit<CommerceAPIConfig, 'apiToken'> {
|
||||
shopId: string
|
||||
cartIdCookie: string
|
||||
dummyEmptyCartId?: string
|
||||
|
@ -8,18 +8,24 @@ import {
|
||||
} from '@commerce'
|
||||
|
||||
import { reactionCommerceProvider, ReactionCommerceProvider } from './provider'
|
||||
import { REACTION_ANONYMOUS_CART_TOKEN_COOKIE, SHOP_ID } from './const'
|
||||
import {
|
||||
REACTION_ANONYMOUS_CART_TOKEN_COOKIE,
|
||||
SHOP_ID,
|
||||
REACTION_CART_ID_COOKIE,
|
||||
} from './const'
|
||||
|
||||
export { reactionCommerceProvider }
|
||||
export type { ReactionCommerceProvider }
|
||||
|
||||
type ReactionConfig = CommerceConfig & {
|
||||
shopId: string
|
||||
anonymousCartTokenCookie: string
|
||||
}
|
||||
|
||||
export const reactionCommerceConfig: ReactionConfig = {
|
||||
locale: 'en-us',
|
||||
anonymousCartTokenCookie: REACTION_ANONYMOUS_CART_TOKEN_COOKIE,
|
||||
cartCookie: REACTION_CART_ID_COOKIE,
|
||||
shopId: SHOP_ID,
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { GraphQLFetcherResult } from '@commerce/api'
|
||||
import { getConfig, ReactionCommerceConfig } from '../api'
|
||||
import { CatalogItemEdge, CatalogItemProduct } from '../schema'
|
||||
import { catalogItemsQuery } from '../utils/queries'
|
||||
import { normalizeProduct } from '../utils/normalize'
|
||||
import { catalogItemsQuery, normalizeProduct } from '../utils'
|
||||
import { Product } from '@commerce/types'
|
||||
|
||||
type Variables = {
|
||||
@ -11,7 +10,7 @@ type Variables = {
|
||||
}
|
||||
|
||||
type ReturnType = {
|
||||
products: CatalogItemConnection[]
|
||||
products: Product[]
|
||||
}
|
||||
|
||||
const getAllProducts = async (options: {
|
||||
|
@ -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