From 8e84beb81027e816f14bd612ce218af6b44d593e Mon Sep 17 00:00:00 2001 From: cond0r Date: Fri, 19 Mar 2021 18:04:19 +0200 Subject: [PATCH] Shopify provider fixes (#239) * Changed to query page by id * Fixed page query, Changed use-search GraphQl query * Update use-search.tsx * remove unused util * Changed cookie expiration * Update tsconfig.json * Fix add to cart & prepare for user activation * Update helpers.ts * Update helpers.ts * Changes, fix Shopify GraphQL deprecations * Update checkout-to-cart.ts * Default to BigCommerce * Update index.ts * Fixed types * Update customer-access-token-delete.ts * Fix item missing path * Update customer-access-token-delete.ts --- .../shopify/utils/mutations/customer-access-token-delete.ts | 2 +- framework/shopify/utils/normalize.ts | 2 +- framework/shopify/utils/queries/get-checkout-query.ts | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/framework/shopify/utils/mutations/customer-access-token-delete.ts b/framework/shopify/utils/mutations/customer-access-token-delete.ts index 208e69c09..c46eff1e5 100644 --- a/framework/shopify/utils/mutations/customer-access-token-delete.ts +++ b/framework/shopify/utils/mutations/customer-access-token-delete.ts @@ -3,7 +3,7 @@ const customerAccessTokenDeleteMutation = /* GraphQL */ ` customerAccessTokenDelete(customerAccessToken: $customerAccessToken) { deletedAccessToken deletedCustomerAccessTokenId - customerUserErrors { + userErrors { field message } diff --git a/framework/shopify/utils/normalize.ts b/framework/shopify/utils/normalize.ts index 5a8e7548b..25bdca053 100644 --- a/framework/shopify/utils/normalize.ts +++ b/framework/shopify/utils/normalize.ts @@ -148,7 +148,7 @@ function normalizeLineItem({ price: variant?.priceV2?.amount, listPrice: variant?.compareAtPriceV2?.amount, }, - path: '', + path: String(variant?.product?.handle), discounts: [], options: // By default Shopify adds a default variant with default names, we're removing it. https://community.shopify.com/c/Shopify-APIs-SDKs/Adding-new-product-variant-is-automatically-adding-quot-Default/td-p/358095 diff --git a/framework/shopify/utils/queries/get-checkout-query.ts b/framework/shopify/utils/queries/get-checkout-query.ts index 194e1619a..d8758e321 100644 --- a/framework/shopify/utils/queries/get-checkout-query.ts +++ b/framework/shopify/utils/queries/get-checkout-query.ts @@ -43,6 +43,9 @@ export const checkoutDetailsFragment = ` amount currencyCode } + product { + handle + } } quantity }