Skip to content

Commit 65aeb4b

Browse files
mattmortekgatsbybot
and
gatsbybot
authored
fix(gatsby-source-shopify): update method of generating published_status when salesChannel parameter is used (#32674)
* fix(gatsby-source-shopify): update method of generating published_status when salesChannel parameter is used * feat(gatsby-source-shopify): update documentation for sales channel parameter * chore: format Co-authored-by: gatsbybot <[email protected]>
1 parent 6f60237 commit 65aeb4b

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

packages/gatsby-source-shopify/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ Not set by default. If set to a string (example `My Sales Channel`), only produc
160160

161161
Note: If you set up your site with the Gatsby Cloud Public App integration, `salesChannel` is set for you.
162162

163+
Note: If you want to filter products by a Private App instead of Public App or default sales channel, you have to provide App ID instead of sales channel name.
164+
163165
<div id="images"></div>
164166

165167
## Images

packages/gatsby-source-shopify/src/query-builders/collections-query.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BulkQuery } from "./bulk-query"
33
export class CollectionsQuery extends BulkQuery {
44
query(date?: Date): string {
55
const publishedStatus = this.pluginOptions.salesChannel
6-
? encodeURIComponent(`${this.pluginOptions.salesChannel}=visible`)
6+
? `'${encodeURIComponent(this.pluginOptions.salesChannel)}:visible'`
77
: `published`
88

99
const filters = [`published_status:${publishedStatus}`]

packages/gatsby-source-shopify/src/query-builders/locations-query.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BulkQuery } from "./bulk-query"
33
export class LocationsQuery extends BulkQuery {
44
query(date?: Date): string {
55
const publishedStatus = this.pluginOptions.salesChannel
6-
? encodeURIComponent(`${this.pluginOptions.salesChannel}=visible`)
6+
? `'${encodeURIComponent(this.pluginOptions.salesChannel)}:visible'`
77
: `published`
88

99
const filters = [`published_status:${publishedStatus}`]

packages/gatsby-source-shopify/src/query-builders/product-variants-query.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BulkQuery } from "./bulk-query"
33
export class ProductVariantsQuery extends BulkQuery {
44
query(date?: Date): string {
55
const publishedStatus = this.pluginOptions.salesChannel
6-
? encodeURIComponent(`${this.pluginOptions.salesChannel}=visible`)
6+
? `'${encodeURIComponent(this.pluginOptions.salesChannel)}:visible'`
77
: `published`
88

99
const filters = [`status:active`, `published_status:${publishedStatus}`]

packages/gatsby-source-shopify/src/query-builders/products-query.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BulkQuery } from "./bulk-query"
33
export class ProductsQuery extends BulkQuery {
44
query(date?: Date): string {
55
const publishedStatus = this.pluginOptions.salesChannel
6-
? encodeURIComponent(`${this.pluginOptions.salesChannel}=visible`)
6+
? `'${encodeURIComponent(this.pluginOptions.salesChannel)}:visible'`
77
: `published`
88

99
const filters = [`status:active`, `published_status:${publishedStatus}`]

0 commit comments

Comments
 (0)