Skip to content

Commit e90a2a7

Browse files
Copilotbookernath
andcommitted
Remove lossy parameters from GraphQL queries and enable LQIP in client
Co-authored-by: bookernath <8922457+bookernath@users.noreply.github.com>
1 parent e395d8b commit e90a2a7

15 files changed

Lines changed: 27 additions & 196 deletions

File tree

core/app/[locale]/(default)/(faceted)/fetch-compare-products.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const CompareProductsQuery = graphql(`
2929
entityId
3030
name
3131
defaultImage {
32-
url: urlTemplate(lossy: true)
32+
url: urlTemplate
3333
altText
3434
}
3535
path

core/app/[locale]/(default)/account/orders/fragment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const OrderItemFragment = graphql(`
1111
path
1212
}
1313
image {
14-
url: urlTemplate(lossy: true)
14+
url: urlTemplate
1515
altText
1616
}
1717
subTotalListPrice {

core/app/[locale]/(default)/blog/[blogId]/page-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const BlogPageQuery = graphql(`
2121
tags
2222
thumbnailImage {
2323
altText
24-
url: urlTemplate(lossy: true)
24+
url: urlTemplate
2525
}
2626
seo {
2727
pageTitle

core/app/[locale]/(default)/blog/page-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const BlogPostsPageQuery = graphql(
4545
utc
4646
}
4747
thumbnailImage {
48-
url: urlTemplate(lossy: true)
48+
url: urlTemplate
4949
altText
5050
}
5151
}

core/app/[locale]/(default)/cart/page-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const PhysicalItemFragment = graphql(`
1212
brand
1313
sku
1414
image {
15-
url: urlTemplate(lossy: true)
15+
url: urlTemplate
1616
}
1717
entityId
1818
quantity
@@ -71,7 +71,7 @@ export const DigitalItemFragment = graphql(`
7171
brand
7272
sku
7373
image {
74-
url: urlTemplate(lossy: true)
74+
url: urlTemplate
7575
}
7676
entityId
7777
quantity

core/app/[locale]/(default)/product/[slug]/_components/product-schema/fragment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const ProductSchemaFragment = graphql(`
1717
numberOfReviews
1818
}
1919
defaultImage {
20-
url: urlTemplate(lossy: true)
20+
url: urlTemplate
2121
}
2222
condition
2323
availabilityV2 {

core/app/[locale]/(default)/product/[slug]/page-data.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ const MultipleChoiceFieldFragment = graphql(`
2525
... on SwatchOptionValue {
2626
__typename
2727
hexColors
28-
imageUrl(lossy: true, width: 40)
28+
imageUrl(width: 40)
2929
}
3030
... on ProductPickListOptionValue {
3131
__typename
3232
defaultImage {
3333
altText
34-
url: urlTemplate(lossy: true)
34+
url: urlTemplate
3535
}
3636
}
3737
}
@@ -140,7 +140,7 @@ const ProductPageMetadataQuery = graphql(`
140140
name
141141
defaultImage {
142142
altText
143-
url: urlTemplate(lossy: true)
143+
url: urlTemplate
144144
}
145145
seo {
146146
pageTitle
@@ -218,14 +218,14 @@ const StreamableProductQuery = graphql(
218218
edges {
219219
node {
220220
altText
221-
url: urlTemplate(lossy: true)
221+
url: urlTemplate
222222
isDefault
223223
}
224224
}
225225
}
226226
defaultImage {
227227
altText
228-
url: urlTemplate(lossy: true)
228+
url: urlTemplate
229229
}
230230
sku
231231
weight {

core/client/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export const client = createClient({
3333
logger:
3434
(process.env.NODE_ENV !== 'production' && process.env.CLIENT_LOGGER !== 'false') ||
3535
process.env.CLIENT_LOGGER === 'true',
36+
imageTransforms: {
37+
enableLossy: true,
38+
lossyQuality: 30,
39+
},
3640
getChannelId: async (defaultChannelId: string) => {
3741
const locale = await getLocale();
3842

core/components/footer/fragment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const FooterFragment = graphql(`
1919
}
2020
... on StoreImageLogo {
2121
image {
22-
url: urlTemplate(lossy: true)
22+
url: urlTemplate
2323
altText
2424
}
2525
}

core/components/header/fragment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const HeaderFragment = graphql(`
1111
}
1212
... on StoreImageLogo {
1313
image {
14-
url: urlTemplate(lossy: true)
14+
url: urlTemplate
1515
altText
1616
}
1717
}

0 commit comments

Comments
 (0)