-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate README Update Insomnia package folder rename folder rename formatting
- Loading branch information
1 parent
88baef5
commit 5bc3163
Showing
6 changed files
with
157 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
examples/10_B2B/01_get_contextualized_products/query.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Including the buyer argument on the @inContext directive will contextualize any storefront queries for a B2B customer. | ||
|
||
# With a contextualized query, you can access a quantityRule and quantityPriceBreaks on a product variant, as well as get a price that's contextualized for the B2B customer. | ||
|
||
# The customerAccessToken and companyLocationId in the BuyerInput are obtained from the Customers API. For details on how to obtain those, see [Headless with B2B](https://shopify.dev/docs/storefronts/headless/bring-your-own-stack/b2b) | ||
query RecommendedProducts ( | ||
$buyer: BuyerInput | ||
) @inContext(buyer: $buyer) { | ||
products(first: 5) { | ||
nodes { | ||
id | ||
variants(first: 5) { | ||
nodes { | ||
id | ||
price | ||
quantityRule { | ||
maximum | ||
minimum | ||
increment | ||
} | ||
quantityPriceBreaks(first: 5) { | ||
nodes { | ||
minimumQuantity | ||
price { | ||
amount | ||
currencyCode | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
examples/10_B2B/01_get_contextualized_products/variables.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
{ | ||
"buyer": { | ||
"customerAccessToken": "shpsb_eyJh123456789", | ||
"companyLocationId": "gid://shopify/CompanyLocation/10079785100" | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
examples/10_B2B/02_create_a_cart_with_buyer_identity/query.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Including the buyerIdentity of a B2B customer will create a contexualized cart. Checkouts made with this cart will be B2B checkouts. | ||
|
||
# The customerAccessToken and companyLocationId in the buyerIdentity are obtained from the Customers API. For details on how to obtain those, see [Headless with B2B](https://shopify.dev/docs/storefronts/headless/bring-your-own-stack/b2b) | ||
mutation createCart($cartInput: CartInput) { | ||
cartCreate(input: $cartInput) { | ||
cart { | ||
id | ||
createdAt | ||
updatedAt | ||
buyerIdentity { | ||
phone | ||
customer { | ||
id | ||
} | ||
countryCode | ||
} | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
examples/10_B2B/02_create_a_cart_with_buyer_identity/variables.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"cartInput": { | ||
"buyerIdentity": { | ||
"customerAccessToken": "shpsb_eyJh123456789", | ||
"companyLocationId": "gid://shopify/CompanyLocation/10079785100" | ||
} | ||
} | ||
} |