Skip to content

Commit

Permalink
feat(gatsby-source-shopify): add default sales channel when using sho…
Browse files Browse the repository at this point in the history
…pify app integration (#32010) (#32030)

* add default sales channel when using shopify app integration

* set default salesChannel during schema initialization

(cherry picked from commit 95280a3)

Co-authored-by: Daniel Lew <51924260+DanielSLew@users.noreply.github.com>
  • Loading branch information
GatsbyJS Bot and DanielSLew committed Jun 22, 2021
1 parent 19fbb6a commit cb914ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/gatsby-source-shopify/README.md
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
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

0 comments on commit cb914ae

Please sign in to comment.