From 2acc21164bb7ed3d055503abdee8cee5476e2853 Mon Sep 17 00:00:00 2001 From: cond0r Date: Thu, 4 Feb 2021 16:18:01 +0200 Subject: [PATCH] fix: cart error on first load --- framework/shopify/utils/mutations/checkout-create.ts | 5 +++-- framework/shopify/utils/queries/get-checkout-query.ts | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/framework/shopify/utils/mutations/checkout-create.ts b/framework/shopify/utils/mutations/checkout-create.ts index 6dfe438b3..912e1cbd2 100644 --- a/framework/shopify/utils/mutations/checkout-create.ts +++ b/framework/shopify/utils/mutations/checkout-create.ts @@ -1,3 +1,5 @@ +import { checkoutDetailsFragment } from '../queries/get-checkout-query' + const checkoutCreateMutation = /* GraphQL */ ` mutation { checkoutCreate(input: {}) { @@ -6,8 +8,7 @@ const checkoutCreateMutation = /* GraphQL */ ` field } checkout { - id - webUrl + ${checkoutDetailsFragment} } } } diff --git a/framework/shopify/utils/queries/get-checkout-query.ts b/framework/shopify/utils/queries/get-checkout-query.ts index 3b57eb83e..5d0b60545 100644 --- a/framework/shopify/utils/queries/get-checkout-query.ts +++ b/framework/shopify/utils/queries/get-checkout-query.ts @@ -19,7 +19,10 @@ export const checkoutDetailsFragment = /* GraphQL */ ` sku title image { - src + originalSrc + altText + width + height } price }