Skip to content

Instantly share code, notes, and snippets.

@rodde177
Last active February 5, 2019 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodde177/df97208ec0d4db72109f834aa8dec7a6 to your computer and use it in GitHub Desktop.
Save rodde177/df97208ec0d4db72109f834aa8dec7a6 to your computer and use it in GitHub Desktop.
Configurable Product GraphQl query
query productDetail($urlKey: String, $onServer: Boolean!) {
productDetail: products(filter: {url_key: {eq: $urlKey}}) {
items {
sku
name
url_key
small_image
price {
regularPrice {
amount {
currency
value
}
}
}
description
media_gallery_entries {
label
position
disabled
file
}
... on ConfigurableProduct {
configurable_options {
attribute_code
attribute_id
id
label
values {
default_label
label
store_label
use_default_value
value_index
}
}
variants {
product {
id
media_gallery_entries {
disabled
file
label
position
}
sku
stock_status
}
}
}
meta_title @include(if: $onServer)
meta_keyword @include(if: $onServer)
meta_description @include(if: $onServer)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment