4
0
forked from crowetic/commerce

Update Shopify API version (#833)

This commit is contained in:
Catalin Pinte 2022-09-28 18:06:31 +03:00 committed by GitHub
parent 11609a9e71
commit 8398a96215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 10024 additions and 6163 deletions

View File

@ -1,6 +1,6 @@
{
"schema": {
"https://${NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN}/api/2022-04/graphql.json": {
"https://${NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN}/api/2022-07/graphql.json": {
"headers": {
"X-Shopify-Storefront-Access-Token": "${NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN}"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,6 @@ export const STORE_DOMAIN = process.env.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN
export const SHOPIFY_COOKIE_EXPIRE = 30
export const API_URL = `https://${STORE_DOMAIN}/api/2021-07/graphql.json`
export const API_URL = `https://${STORE_DOMAIN}/api/2022-07/graphql.json`
export const API_TOKEN = process.env.NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN

View File

@ -53,7 +53,7 @@ const normalizeProductOption = ({
}
const normalizeProductImages = ({ edges }: ImageConnection) =>
edges?.map(({ node: { originalSrc: url, ...rest } }) => ({
edges?.map(({ node: { url, ...rest } }) => ({
url,
...rest,
}))
@ -161,7 +161,7 @@ function normalizeLineItem({
sku: variant?.sku ?? '',
name: variant?.title!,
image: {
url: variant?.image?.originalSrc || '/product-img-placeholder.svg',
url: variant?.image?.url || '/product-img-placeholder.svg',
},
requiresShipping: variant?.requiresShipping ?? false,
price: variant?.priceV2?.amount,

View File

@ -23,7 +23,7 @@ export const productConnectionFragment = /* GraphQL */ `
}
edges {
node {
originalSrc
url
altText
width
height

View File

@ -35,7 +35,7 @@ export const checkoutDetailsFragment = /* GraphQL */ `
value
}
image {
originalSrc
url
altText
width
height

View File

@ -58,7 +58,7 @@ const getProductQuery = /* GraphQL */ `
}
edges {
node {
originalSrc
url
altText
width
height