Get information about specific product and specific attribute values in specific language
This is an example of how you can get values of specific attributes in specific languages of a specific product using pagination.
Please keep in mind that this is just an example and more data can be pulled. How to deal with other attribute types can be seen in the fragment AttributeValue here.
query getAttValues {
product(sku: "0123456789") {
# SKU of a single product to get data from
sku
createdAt
editedAt
template {
code
}
attributeList(
first: 10 # nuber of entries to return in a single page (max response time is 60s)
after: "YXJyYXljb25uZWN0aW9uOjA=" # endCursor from the response to get rest of the data if "hasNextPage": true
codes: [
# attributes to get values from
"name"
"color"
"short_description"
"price_local_eur"
"galeria_zdjec"
]
) {
... on AttributeValueConnection {
pageInfo {
hasNextPage
endCursor
}
edges {
node {
... on PriceAttributeValue {
priceAttribute: attribute {
# currency might be useful in the price context
currency
}
priceAttributeValue: translations(
languages: ["en_GB", "pl_PL"]
) {
language
value
}
}
... on SelectAttributeValue {
SelectAttributeValue: translations(
languages: ["en_GB", "pl_PL"]
) {
language
translatedValue {
...OptionTranslatedValue
}
}
}
... on TextAttributeValue {
attribute {
name(languages: ["en_GB", "pl_PL"]) {
language
value
}
}
TextAttributeValue: translations(
languages: ["en_GB", "pl_PL"]
) {
language
value
}
}
... on TextareaAttributeValue {
attribute {
name(languages: ["en_GB", "pl_PL"]) {
language
value
}
}
TextareaAttributeValue: translations(
languages: ["en_GB", "pl_PL"]
) {
language
value
}
}
... on GalleryAttributeValue {
GalleryAttributeValue: translations {
language
value {
...Multimedia
}
}
}
}
}
}
}
__typename
}
}
fragment Multimedia on Multimedia {
path
name
extension
mime
sizeInBytes: size
alt(languages: ["en_GB", "pl_PL"]) {
language
value
}
title(languages: ["en_GB", "pl_PL"]) {
language
value
}
}
fragment OptionTranslatedValue on OptionTranslatedValue {
code
name
}
{
"data": {
"product": {
"sku": "0123456789",
"createdAt": "2024-04-04T11:44:54+00:00",
"editedAt": "2024-04-04T13:33:46+00:00",
"template": {
"code": "GraphQL"
},
"attributeList": {
"pageInfo": {
"hasNextPage": false,
"endCursor": "YXJyYXljb25uZWN0aW9uOjQ="
},
"edges": [
{
"node": {
"SelectAttributeValue": [
{
"language": "en_GB",
"translatedValue": {
"code": "blk",
"name": "Black"
}
},
{
"language": "pl_PL",
"translatedValue": {
"code": "blk",
"name": "Czarny"
}
}
]
}
},
{
"node": {
"attribute": {
"name": [
{
"language": "en_GB",
"value": "Short description"
},
{
"language": "pl_PL",
"value": "Krótki opis"
}
]
},
"TextareaAttributeValue": [
{
"language": "en_GB",
"value": "Short countertop description"
},
{
"language": "pl_PL",
"value": "Krótki opis blatu"
}
]
}
},
{
"node": {
"priceAttribute": {
"currency": "EUR"
},
"priceAttributeValue": [
{
"language": "en_GB",
"value": 10.1
},
{
"language": "pl_PL",
"value": 9.99
}
]
}
},
{
"node": {
"GalleryAttributeValue": [
{
"language": "en_GB",
"value": [
{
"path": "semir-beige-kapinos-stopnica-narozna-33x33-g1.webp",
"name": "semir-beige-kapinos-stopnica-narozna-33x33-g1.webp",
"extension": "webp",
"mime": "image\/webp",
"sizeInBytes": 46116,
"alt": [
{
"language": "en_GB",
"value": null
},
{
"language": "pl_PL",
"value": null
}
],
"title": [
{
"language": "en_GB",
"value": null
},
{
"language": "pl_PL",
"value": null
}
]
},
{
"path": "ILARIO_Beige_stopnica_narozna_kapinos_330x330_3D@2x.webp",
"name": "ILARIO_Beige_stopnica_narozna_kapinos_330x330_3D@2x.webp",
"extension": "webp",
"mime": "image\/webp",
"sizeInBytes": 158884,
"alt": [
{
"language": "en_GB",
"value": null
},
{
"language": "pl_PL",
"value": null
}
],
"title": [
{
"language": "en_GB",
"value": null
},
{
"language": "pl_PL",
"value": null
}
]
}
]
},
{
"language": "pl_PL",
"value": [
{
"path": "semir-beige-kapinos-stopnica-narozna-33x33-g1.webp",
"name": "semir-beige-kapinos-stopnica-narozna-33x33-g1.webp",
"extension": "webp",
"mime": "image\/webp",
"sizeInBytes": 46116,
"alt": [
{
"language": "en_GB",
"value": null
},
{
"language": "pl_PL",
"value": null
}
],
"title": [
{
"language": "en_GB",
"value": null
},
{
"language": "pl_PL",
"value": null
}
]
},
{
"path": "ILARIO_Beige_stopnica_narozna_kapinos_330x330_3D@2x.webp",
"name": "ILARIO_Beige_stopnica_narozna_kapinos_330x330_3D@2x.webp",
"extension": "webp",
"mime": "image\/webp",
"sizeInBytes": 158884,
"alt": [
{
"language": "en_GB",
"value": null
},
{
"language": "pl_PL",
"value": null
}
],
"title": [
{
"language": "en_GB",
"value": null
},
{
"language": "pl_PL",
"value": null
}
]
}
]
},
{
"language": "de_DE",
"value": [
{
"path": "semir-beige-kapinos-stopnica-narozna-33x33-g1.webp",
"name": "semir-beige-kapinos-stopnica-narozna-33x33-g1.webp",
"extension": "webp",
"mime": "image\/webp",
"sizeInBytes": 46116,
"alt": [
{
"language": "en_GB",
"value": null
},
{
"language": "pl_PL",
"value": null
}
],
"title": [
{
"language": "en_GB",
"value": null
},
{
"language": "pl_PL",
"value": null
}
]
},
{
"path": "ILARIO_Beige_stopnica_narozna_kapinos_330x330_3D@2x.webp",
"name": "ILARIO_Beige_stopnica_narozna_kapinos_330x330_3D@2x.webp",
"extension": "webp",
"mime": "image\/webp",
"sizeInBytes": 158884,
"alt": [
{
"language": "en_GB",
"value": null
},
{
"language": "pl_PL",
"value": null
}
],
"title": [
{
"language": "en_GB",
"value": null
},
{
"language": "pl_PL",
"value": null
}
]
}
]
}
]
}
}
]
},
"__typename": "SimpleProduct"
}
}
}
PreviousList of products with attributes and they values in product streamNextList of 100 grouped products with simple and variable products in stream
Last updated