Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gatsby-source-shopify): add default sales channel when using shopify app integration (#32010) #32030

Merged
merged 1 commit into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/gatsby-source-shopify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ Not set by default. If set to a string (example `MyStore`) node names will be `a

Not set by default. If set to a string (example `My Sales Channel`), only products and collections that are active in that channel will be sourced. If no sales channel is provided, the default behavior is to source products that are available in the online store.

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

<div id="images"></div>

## Images
Expand Down
4 changes: 3 additions & 1 deletion packages/gatsby-source-shopify/src/gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export function pluginOptionsSchema({
shopifyConnections: Joi.array()
.default([])
.items(Joi.string().valid(`orders`, `collections`)),
salesChannel: Joi.string(),
salesChannel: Joi.string().default(
process.env.GATSBY_SHOPIFY_SALES_CHANNEL
),
})
}

Expand Down