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

DEVDOCS-4244: [net new] Storefront GraphQL products and variants #1625

Merged
merged 119 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
3137f71
created 8 md files
bc-andreadao Jul 12, 2022
e9e7fa3
edited toc.json
bc-andreadao Jul 12, 2022
e2e54d5
removed old code samples toc.json
bc-andreadao Jul 12, 2022
2cb0d47
added headings to products and variants
bc-andreadao Sep 1, 2022
fd0a34f
intro placeholder
bc-andreadao Oct 27, 2022
62b3793
added product info and basic info
bc-andreadao Oct 27, 2022
f98820e
added prices and dimensions
bc-andreadao Oct 27, 2022
b25bfa2
added references to variants page
bc-andreadao Oct 27, 2022
22fb17c
copyedit
bc-andreadao Oct 27, 2022
2bf1bf5
product options section
bc-andreadao Oct 27, 2022
0d79123
whitespace
bc-andreadao Oct 27, 2022
5865a89
example for multiple choice product option
bc-andreadao Oct 28, 2022
1131b5c
white space
bc-andreadao Oct 28, 2022
1476c26
added example for images
bc-andreadao Oct 28, 2022
2188015
added product metafields
bc-andreadao Oct 28, 2022
40365b4
added custom fields
bc-andreadao Oct 28, 2022
7ba544f
added gift wrapping option
bc-andreadao Oct 28, 2022
2c20e6f
added reviews
bc-andreadao Oct 28, 2022
c8435eb
removed related products
bc-andreadao Oct 28, 2022
f61e5ff
added get a product
bc-andreadao Oct 28, 2022
deda6cd
edited intro
bc-andreadao Oct 28, 2022
2c8a7cc
removed repeated example
bc-andreadao Oct 28, 2022
d628adb
added images at diff resolutions
bc-andreadao Oct 28, 2022
cd811ab
how to get a product via products
bc-andreadao Oct 28, 2022
f78a6c7
removed unneeded examples
bc-andreadao Oct 28, 2022
0c20a15
removed unneeded example
bc-andreadao Oct 28, 2022
9524a7f
get product vs variant
bc-andreadao Oct 31, 2022
1b9fea9
removed extraneous detail
bc-andreadao Oct 31, 2022
c5d0bc0
Get a variant, moved examples to variant page
bc-andreadao Oct 31, 2022
76dddd9
Variant examples
bc-andreadao Oct 31, 2022
8bf516f
added get variant via variant sku
bc-andreadao Oct 31, 2022
18fdd89
clarify product and variant entity ID
bc-andreadao Oct 31, 2022
81251da
metafield description
bc-andreadao Nov 1, 2022
53fc004
edited descriptions
bc-andreadao Nov 1, 2022
96a5283
added intro for variant page
bc-andreadao Nov 2, 2022
b84e0ec
link to products
bc-andreadao Nov 2, 2022
d023a90
headings
bc-andreadao Nov 2, 2022
3c99756
all variants and products
bc-andreadao Nov 2, 2022
7edaddc
added example to get a product and variant
bc-andreadao Nov 3, 2022
3e6a817
removed files (include in different PR)
bc-andreadao Nov 3, 2022
f3cb4d6
added href to toc.json
bc-andreadao Nov 3, 2022
14c6a7d
links to graphql pages
bc-andreadao Nov 4, 2022
272bbf9
added code block comments
bc-andreadao Nov 4, 2022
68d7fed
edited in line code comments
bc-andreadao Nov 4, 2022
2049cb8
copyedit in line code comments
bc-andreadao Nov 4, 2022
16fca83
get variant options vs get product optoins
bc-andreadao Nov 4, 2022
a108953
updated examples for variant options
bc-andreadao Nov 7, 2022
b46af88
added explanation for variant optoins
bc-andreadao Nov 7, 2022
ca07094
edited variant option values (example and description)
bc-andreadao Nov 8, 2022
6535723
copyedit variant option values
bc-andreadao Nov 8, 2022
c471a7f
copyedit
bc-andreadao Nov 8, 2022
37a76f4
edit explanation
bc-andreadao Nov 9, 2022
ad1be72
copyedit
bc-andreadao Nov 9, 2022
f40d1a2
copyedit product options
bc-andreadao Nov 11, 2022
ca7fdee
copyedit
bc-andreadao Nov 11, 2022
77cce67
copyedits
bc-andreadao Nov 11, 2022
9a505f5
copyedit
bc-andreadao Nov 11, 2022
c83b25b
copyedit
bc-andreadao Nov 11, 2022
2347f9c
copyedit
bc-andreadao Nov 11, 2022
9b44f9c
copyedit
bc-andreadao Nov 11, 2022
7e69b4f
copyedit for a list of products
bc-andreadao Dec 12, 2022
c734b71
copyedit intro
bc-andreadao Dec 12, 2022
a124d5e
copyedited intro
bc-andreadao Dec 12, 2022
264ea87
added pagination to variant queries
bc-andreadao Dec 13, 2022
728d01c
added in pagination for product
bc-andreadao Dec 13, 2022
d23a230
copyedit variants
bc-andreadao Dec 13, 2022
98b18cb
copyedit examples and sentences
bc-andreadao Dec 13, 2022
a7d4d1c
copyedit variant examples
bc-andreadao Dec 13, 2022
6c2ecd7
variants only have 1 image
bc-andreadao Dec 13, 2022
5a84de9
copyedit
bc-andreadao Jan 3, 2023
ddcc757
copyedit
bc-andreadao Jan 3, 2023
b341124
copyedit
bc-andreadao Jan 3, 2023
ebe39b5
copyedit
bc-andreadao Jan 3, 2023
13d1358
copyedit
bc-andreadao Jan 3, 2023
fb808fe
copyedit
bc-andreadao Jan 3, 2023
b9824fd
copyedit
bc-andreadao Jan 3, 2023
20261c2
copyedit
bc-andreadao Jan 3, 2023
0e69cf1
copyedit
bc-andreadao Jan 3, 2023
697410f
copyedit\
bc-andreadao Jan 3, 2023
afd6baf
copyedit
bc-andreadao Jan 3, 2023
fe74fbe
copyedit
bc-andreadao Jan 3, 2023
a9516b3
copyedit
bc-andreadao Jan 3, 2023
70bb235
copyedit
bc-andreadao Jan 3, 2023
7ebf8a8
copyedit
bc-andreadao Jan 3, 2023
8d16c72
copyedit
bc-andreadao Jan 3, 2023
ecfb61d
copyedit
bc-andreadao Jan 3, 2023
84045be
copyedit
bc-andreadao Jan 3, 2023
0cf2218
copyedit
bc-andreadao Jan 3, 2023
984cd73
copyedit
bc-andreadao Jan 3, 2023
da02b4a
copyedit
bc-andreadao Jan 3, 2023
0a65ff0
copyedit
bc-andreadao Jan 3, 2023
6b51d56
copyedit
bc-andreadao Jan 3, 2023
6087014
copyedit
bc-andreadao Jan 3, 2023
d6fd968
copyedit
bc-andreadao Jan 3, 2023
0291aa7
copyedit
bc-andreadao Jan 3, 2023
68c9b6a
copyedit
bc-andreadao Jan 3, 2023
b99a4a5
copyedit
bc-andreadao Jan 3, 2023
8f324aa
copyedit
bc-andreadao Jan 3, 2023
a30ce92
copyedit
bc-andreadao Jan 3, 2023
487a052
copyedit
bc-andreadao Jan 3, 2023
b1b6fbc
copyedit
bc-andreadao Jan 3, 2023
543499b
copyedit
bc-andreadao Jan 3, 2023
da7234f
copyedit
bc-andreadao Jan 3, 2023
83d18d6
copyedit
bc-andreadao Jan 3, 2023
ed22ddd
copyedit
bc-andreadao Jan 3, 2023
b346adc
Solve merge conflicts, Merge main to head branch
bc-andreadao Sep 6, 2023
2dd8361
migrate syntax
bc-andreadao Sep 6, 2023
a32c7b3
add note about default
bc-andreadao Sep 6, 2023
f8dc135
update titles to guide, move GraphQL Storefront API into a prefacing …
Sep 7, 2023
63f7a83
add review notes
Sep 7, 2023
1a871aa
change files to .mdx
bc-andreadao Sep 7, 2023
2b569d9
changes per sarah's review
bc-andreadao Sep 7, 2023
743ce59
indent tab, remove unneeded comments
bc-andreadao Sep 7, 2023
5f07348
copyedit per sarah's review
bc-andreadao Sep 7, 2023
ee6e9e5
copyedit
bc-andreadao Sep 14, 2023
bc617c9
copyedit
bc-andreadao Sep 14, 2023
476d528
Merge branch 'main' into DEVDOCS-4244-graphql
bc-andreadao Sep 14, 2023
f97ff19
Merge branch 'main' into DEVDOCS-4244-graphql
bc-andreadao Sep 19, 2023
04406d7
Merge branch 'main' into DEVDOCS-4244-graphql
Sep 21, 2023
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
214 changes: 0 additions & 214 deletions docs/api-docs/storefront/graphql/graphql-api-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,218 +159,4 @@ query LookUpUrl {

<a href="https://developer.bigcommerce.com/graphql?playground_tab=objectsByUrl" target="_blank">**Try it in GraphQL Playground**</a>

## Get product images at different resolutions

```graphql title="Example query: Get product images at different resolutions" lineNumbers
query SrcsetImages {
site {
product(entityId: 123) {
images {
edges {
node {
url320wide: url(width: 320)
url640wide: url(width: 640)
url960wide: url(width: 960)
url1280wide: url(width: 1280)
}
}
}
}
}
}
```

<a href="https://developer.bigcommerce.com/graphql?playground_tab=productImages" target="_blank">**Try it in GraphQL Playground**</a>

## Get a product

```graphql title="Example query: Get a product" lineNumbers
query SingleProduct {
site {
products (entityIds: [4917]) {
edges {
node {
id
entityId
name
prices {
price {
value
currencyCode
}
}
}
}
}
}
}
```

<a href="https://developer.bigcommerce.com/graphql?playground_tab=singleProduct" target="_blank">**Try it in GraphQL Playground**</a>

## Get variant details as a product object

```graphql title="Example query: Get variant details as a product object" lineNumbers
query VariantById {
site {
product(variantEntityId: 27098) {
name
sku
defaultImage {
url(width: 500, height: 500)
}
prices {
price {
...PriceFields
}
salePrice {
...PriceFields
}
retailPrice {
...PriceFields
}
}
width {
...DimensionFields
}
height {
...DimensionFields
}
depth {
...DimensionFields
}
}
}
}
fragment PriceFields on Money {
value
currencyCode
}
fragment DimensionFields on Measurement {
value
unit
}
```

<!-- theme: info -->
> This query returns variant information appropriately overlaid on the Product object. For example, if the variant has a different image, dimensions, SKU, or price, that will be automatically returned -- this allows for directly merchandising particular variants.



<a href="https://developer.bigcommerce.com/graphql?playground_tab=variantDetails" target="_blank">**Try it in GraphQL Playground**</a>

## Get product option details by product ID

```graphql title="Example query: Get product option details by product ID" lineNumbers
query SeveralProductsByID {
site {
products(entityIds: [1, 2, 3]) {
edges {
node {
name
productOptions {
edges {
node {
entityId
displayName
isRequired
... on MultipleChoiceOption {
values {
edges {
node {
entityId
label
}
}
}
}
}
}
}
}
}
}
}
}
```

<a href="https://developer.bigcommerce.com/graphql?playground_tab=productOptions" target="_blank">**Try it in GraphQL Playground**</a>

## Get refined product object for given options

```graphql title="Example query: Get refined product object for given options" lineNumbers
query ProductsWithOptionSelections {
site {
product123: product(
entityId: 123
optionValueIds: [
{ optionEntityId: 4, valueEntityId: 543 }
{ optionEntityId: 5, valueEntityId: 443 }
]
) {
...ProductFields
}
product234: product(
entityId: 234
optionValueIds: [
{ optionEntityId: 8, valueEntityId: 768 }
{ optionEntityId: 13, valueEntityId: 883 }
]
) {
...ProductFields
}
}
}

fragment ProductFields on Product {
name
defaultImage {
url(width: 1000)
}
sku
}
```

<a href="https://developer.bigcommerce.com/graphql?playground_tab=refinedProduct" target="_blank">**Try it in GraphQL Playground**</a>

## Get product swatch option values

```graphql title="Example query: Get product swatch option values" lineNumbers
query {
site {
products (first: 3) {
pageInfo {
startCursor
endCursor
}
edges {
cursor
node {
entityId
name
productOptions {
edges {
node {
entityId
displayName
... on MultipleChoiceOption {
values {
edges {
node {
... on SwatchOptionValue {
label
hexColors
}
}
}
}
}
}
}
}
}
}
}
}
}
```
Loading